Re: Bottleneck?

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Ip Wing Kin John <wkipjohn(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Bottleneck?
Date: 2009-08-06 07:03:25
Message-ID: dcc563d10908060003m3b487ee1h4da80dc5a7213aa1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

OK, two things. First the row estimate starts going way off around
the time it gets to the hash aggregate / nested loop which seems to be
making the planner use a bad plan for this many rows. You can try
issuing

set enable_nestloop = off;

before running the query and see if that makes it any faster.

Secondly, the first time you run this query you are reading the 1.8G
table sequentially, and at about 55MB/s, which isn't gonna get faster
without more / faster drives under your machine.

On Thu, Aug 6, 2009 at 12:50 AM, Ip Wing Kin John<wkipjohn(at)gmail(dot)com> wrote:
> Here u go. Both in the same file.
>
> On Thu, Aug 6, 2009 at 4:48 PM, Scott Marlowe<scott(dot)marlowe(at)gmail(dot)com> wrote:
>> Much better... Looks like I got the second one...
>>
>> Can I get the first one too?  Thx.
>>
>> On Thu, Aug 6, 2009 at 12:46 AM, Ip Wing Kin John<wkipjohn(at)gmail(dot)com> wrote:
>>> Hope you can get it this time.
>>>
>>> John
>>>
>>> On Thu, Aug 6, 2009 at 4:34 PM, Scott Marlowe<scott(dot)marlowe(at)gmail(dot)com> wrote:
>>>> Sorry man, it's not coming through.  Try it this time addressed just to me.
>>>>
>>>> On Thu, Aug 6, 2009 at 12:23 AM, Ip Wing Kin John<wkipjohn(at)gmail(dot)com> wrote:
>>>>> Hi scott
>>>>>
>>>>> I attached the query plan with this email. The top one is the first
>>>>> run after I restarted my machine. And the bottom one is the second
>>>>> run.
>>>>>
>>>>> I am using PostgreSQL 8.3 on Solaris 10.
>>>>>
>>>>> cheers
>>>>>
>>>>> On Thu, Aug 6, 2009 at 4:15 PM, Scott Marlowe<scott(dot)marlowe(at)gmail(dot)com> wrote:
>>>>>> On Wed, Aug 5, 2009 at 11:21 PM, <wkipjohn(at)gmail(dot)com> wrote:
>>>>>>> Sorry post again.
>>>>>>
>>>>>> Nope, still mangled.  Can you attach it?
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> John
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> When fascism comes to America, it will be intolerance sold as diversity.
>>>>
>>>
>>>
>>>
>>> --
>>> John
>>>
>>
>>
>>
>> --
>> When fascism comes to America, it will be intolerance sold as diversity.
>>
>
>
>
> --
> John
>

--
When fascism comes to America, it will be intolerance sold as diversity.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Ray Stell 2009-08-06 14:53:07 Re: Bottleneck?
Previous Message Ip Wing Kin John 2009-08-06 06:23:22 Re: Bottleneck?