From: Tom Lane <tgl@sss.pgh.pa.us>
To: plukovic <petar@sobot.biz>
Cc: pgsql-performance@postgresql.org
Subject: Re: Speed differences between in executing the same query
Date: Thu, 11 May 2017 10:06:58 -0400
Message-ID: <8393.1494511618@sss.pgh.pa.us> (raw)
In-Reply-To: <1494510842628-5960964.post@n3.nabble.com>
References: <1494510842628-5960964.post@n3.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
plukovic <petar@sobot.biz> writes:
> I have a weird case of query execution performance here.
My first thought is that you are getting a bad plan because of this
estimation error:
> -> Index Scan using uk_TBL_sk0_account_code on TBL_sk
> sk2_ (cost=0.14..12.53 rows=1 width=426) (actual time=1.036..1.084 rows=50
> loops=1)
> Index Cond: (acco_id = 1)
That rowcount estimate is off by 50X, resulting in 50X errors for the
joins above it too, and in misguided choices of nestloops when some
other join method would be better. Probably things would improve with
a better estimate. Maybe you need to increase the stats target for
that table ... or maybe it just hasn't been ANALYZEd lately?
regards, tom lane
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, petar@sobot.biz
Subject: Re: Speed differences between in executing the same query
In-Reply-To: <8393.1494511618@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox