Re: BUG #6426: Complex query runs 10 times longer with "LIMIT 20"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Schetinin <aschetinin(at)gmail(dot)com>
Cc: Alex Lai <alai(at)sesda2(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6426: Complex query runs 10 times longer with "LIMIT 20"
Date: 2012-02-01 21:48:35
Message-ID: 24544.1328132915@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andrew Schetinin <aschetinin(at)gmail(dot)com> writes:
> In my specific case, what I've seen from the query execution plans, is that
> without LIMIT the query uses Hash Joins, but once I add LIMIT, it starts
> using Nested Loop Joins almost everywhere.

Usually, that's an appropriate change for a small LIMIT. It's certainly
not a priori evidence of a planner bug.

If you want useful comments about this, please review
http://wiki.postgresql.org/wiki/Slow_Query_Questions
about how to provide an adequate description of your problem.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message bdmytrak@eranet.pl 2012-02-01 21:49:54 Re: BUG #6421: Revoke column level privilage
Previous Message Tom Lane 2012-02-01 21:43:34 Re: BUG #6425: Bus error in slot_deform_tuple