Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group