Re: Odd Row Estimates in Query Plan (rows=75)

2018-08-16 Thread Laurenz Albe
Don Seiler wrote: > We have a report query that has gone from maybe a few seconds to run to a few > minutes to run since mid-July. > Looking at the output of EXPLAIN ANALYZE, the row count estimates are way > off, even though this table was > just analyzed a day or so ago. What's more bizarre to

Re: Odd Row Estimates in Query Plan (rows=75)

2018-08-15 Thread Don Seiler
On Wed, Aug 15, 2018 at 3:31 PM, Adrian Klaver wrote: > > lts.date_added > '2017-07-14 11:13:05' > > and > > lts.date_gifted >= '2017-08-13 11:13:05' > ? > > In other words one '>' and the other '>=' ? > The date_added filters were added just to use that index and with a broad r

Re: Odd Row Estimates in Query Plan (rows=75)

2018-08-15 Thread Adrian Klaver
On 08/15/2018 01:03 PM, Don Seiler wrote: Here's the query, obfuscated manually by me: SELECT         'Foo' as system_function, stores.name as store,         lt.owner,         lt.minute_of_day,         lt.records         FROM         foo.stores         LEFT OUTER JOIN

Re: Odd Row Estimates in Query Plan (rows=75)

2018-08-15 Thread Don Seiler
Here's the query, obfuscated manually by me: SELECT 'Foo' as system_function, stores.name as store, lt.owner, lt.minute_of_day, lt.records FROM foo.stores LEFT OUTER JOIN (SELECT lts.store_pkey,

Re: Odd Row Estimates in Query Plan (rows=75)

2018-08-15 Thread Adrian Klaver
On 08/15/2018 12:31 PM, Don Seiler wrote: PostgreSQL 9.6.6 on CentOS. We have a report query that has gone from maybe a few seconds to run to a few minutes to run since mid-July. Looking at the output of EXPLAIN ANALYZE, the row count estimates are way off, even though this table was just ana

Odd Row Estimates in Query Plan (rows=75)

2018-08-15 Thread Don Seiler
PostgreSQL 9.6.6 on CentOS. We have a report query that has gone from maybe a few seconds to run to a few minutes to run since mid-July. Looking at the output of EXPLAIN ANALYZE, the row count estimates are way off, even though this table was just analyzed a day or so ago. What's more bizarre to m