Re: Order by (for 15 rows) adds 30 seconds to query time

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: "Matthew Wakeling" <matthew(at)flymine(dot)org>, jmpoure(at)free(dot)fr, "PostgreSQL Performance" <pgsql-performance(at)postgresql(dot)org>, "Craig Ringer" <craig(at)postnewspapers(dot)com(dot)au>
Subject: Re: Order by (for 15 rows) adds 30 seconds to query time
Date: 2009-12-02 21:48:32
Message-ID: 22914.1259790512@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
> Estimates extracted from the problem plan:

> Nested Loop Left Join (rows=806903677108)
> -> Nested Loop Left Join (rows=203176856)
> -> Nested Loop Left Join (rows=51160)
> -> Nested Loop Left Join (rows=28)
> -> Append (rows=4)
> -> Append (rows=2)
> -> Append (rows=2)

That does look weird. Do we have a self-contained test case?

I wouldn't necessarily expect the join rowcount to be exactly the
product of the input rowcounts, but it shouldn't be that far off,
I should think.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2009-12-02 22:02:15 Re: Order by (for 15 rows) adds 30 seconds to query time
Previous Message Kevin Grittner 2009-12-02 21:33:04 Re: Order by (for 15 rows) adds 30 seconds to query time