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

From: Don Seiler <don(at)seiler(dot)us>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Odd Row Estimates in Query Plan (rows=75)
Date: 2018-08-15 20:34:33
Message-ID: CAHJZqBAV1nx_AT9yc_jfZw6+ip=AVe7a8Ugr6PDP0RX_1BOU6w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Aug 15, 2018 at 3:31 PM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
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
range, since there isn't a filter on date_gifted. You'll notice the
date_added range is 30 days but the date_gifted range is 3 hours. We really
only care about date_gifted but at this time there isn't an index on that
field.

Even as I experiment with some query rewrites, the EXPLAIN ANALYZE always
says rows=75. I'm *very* curious to see why it is using that value.

Don.

--
Don Seiler
www.seiler.us

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Steele 2018-08-15 20:41:27 Re: During promotion, new master tries to archive same segment twice
Previous Message Adrian Klaver 2018-08-15 20:31:17 Re: Odd Row Estimates in Query Plan (rows=75)