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

From: Alex Lai <alai(at)sesda2(dot)com>
To: Andrew Schetinin <aschetinin(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6426: Complex query runs 10 times longer with "LIMIT 20"
Date: 2012-02-01 20:19:53
Message-ID: 4F299E69.4080605@sesda2.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andrew Schetinin wrote:
> Hi Alex,
>
> Thank you. I played with subqueries, but in this case I did not see a
> good enough improvement.
>
> 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.
>
> Regards,
>
> Andrew
>
> On Wed, Feb 1, 2012 at 9:42 PM, Alex Lai <alai(at)sesda2(dot)com
> <mailto:alai(at)sesda2(dot)com>> wrote:
>
> Hi Andrew,
> I posted for another post, its may give you a workaround.
> I still not fully understand how PG choose execute plan that slow
> down so much.
>
> I had the same situation in one of my query.
> Use the subquery can speed up almost by 100 times faster.
>
> ..........
>
>
>
> Hope this help.
>
>
> Best Regards,
> Alex Lai
>
> --
> Best regards,
>
>
> Alex Lai
> OMI SIPS DBA ADNET Systems , Inc. 7515 Mission Drive, Suite A100
> Lanham, MD 20706 301-352-4657 (phone) 301-352-0437 (fax)
> alai(at)sesda2(dot)com <mailto:alai(at)sesda2(dot)com>
>
>
>
>
> --
> --
> Andrew Schetinin
Hi Andrew,

I am interested in see your query.

--
Best regards,

Alex Lai
OMI SIPS DBA ADNET Systems , Inc.
7515 Mission Drive,
Suite A100 Lanham, MD 20706
301-352-4657 (phone)
301-352-0437 (fax)
alai(at)sesda2(dot)com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Duncan Rance 2012-02-01 20:43:48 Re: BUG #6425: Bus error in slot_deform_tuple
Previous Message Andrew Schetinin 2012-02-01 20:05:15 Re: BUG #6426: Complex query runs 10 times longer with "LIMIT 20"