Re: optimizing a cpu-heavy query

From: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Joel Reymont <joelr1(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: optimizing a cpu-heavy query
Date: 2011-05-19 08:27:50
Message-ID: BANLkTikrtFzuAfpe1nk1_Uv8ij1GxB1FJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2011/4/27 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Joel Reymont <joelr1(at)gmail(dot)com> writes:
>> On Apr 26, 2011, at 5:00 PM, Tom Lane wrote:
>>> For another couple orders of magnitude, convert the sub-function to C code.  (I don't think you need
>>> a whole data type, just a function that does the scalar product.)
>
>> That's a 30x speedup, from 12 minutes down to 38s. Thanks Tom!
>
> Huh, I would've bet on a lot more actually.  The nodeFunctionscan and
> nodeAgg code must not be as inefficient as it looks on the surface ...

Did you mean in that case you can optimize it by collapsing those
nodes into one?

Regards,

--
Hitoshi Harada

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2011-05-19 08:30:03 Re: question about readonly instances
Previous Message Albe Laurenz 2011-05-19 08:21:13 Re: Unique Session ID in PGSQL?