Re: More records after sort - Mailing list pgsql-general

From Tom Lane
Subject Re: More records after sort
Date
Msg-id 485659.1626800863@sss.pgh.pa.us
Whole thread Raw
In response to Re: More records after sort  (Nicolas Seinlet <nicolas@seinlet.com>)
List pgsql-general
Nicolas Seinlet <nicolas@seinlet.com> writes:
> Many thanks for the fast response. The full query plan is below, and the Dalibo link points to it as well. You're
right,it's a merge join. One table doesn't have up-to-date statistics, because the table is filled during the
transactioninvolving this query. 

Sure looks like incorporating an ANALYZE into the transaction would help
matters.  This misestimation:

>                                                    ->  Seq Scan on account_invoice_line il  (cost=0.00..9885.48
rows=752width=22) (actual time=0.049..121.238 rows=150448 loops=1) 
>                                                          Filter: (display_type IS NULL)

looks like it's really hurting you, and "ANALYZE account_invoice_line"
after loading that table ought to be enough to fix that.

            regards, tom lane



pgsql-general by date:

Previous
From: Nicolas Seinlet
Date:
Subject: Re: More records after sort
Next
From: Rob Sargent
Date:
Subject: Re: More records after sort