Re: Analysis Function

From: David Jarvis <thangalin(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Analysis Function
Date: 2010-06-11 17:09:49
Message-ID: AANLkTikPcYh1vMxVynxGnD4RCch8-DMixiGK1v9kO17Z@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

The C function returns a DateADT, which is a typedef for int32, but the
> CREATE FUNCTION statement claims that it returns 'text'.
>

That'll do it. Thank you!

but whether that is faster or slower I don't know. But I
> don't see why this query needs to be fast in the first
> place. It seems to be interactive, and therefore I wouldn't
>

When users click the button, I want the result returned in in less under 4
seconds. Right now it is closer to 10. Consequently, they click twice.
Shaving 2 seconds here and there will make a huge difference. It will also
allow the computer to handle a higher volume of requests.

> invest too much time to have the user wait not 4.4, but
> 2.2 seconds. You could also do the concatenation in the ap-
> plication if that is faster than PostgreSQL's date arithme-
> tics.
>

No, I cannot. The concatenation uses the year that the measurement was
made--from the database--and the month/day combination from the user. See
also:

http://stackoverflow.com/questions/2947105/calculate-year-for-end-date-postgresql

Dave

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Andres Freund 2010-06-11 17:12:26 Re: Error with GIT Repository
Previous Message John Reeve 2010-06-11 16:34:30 Re: Large (almost 50%!) performance drop after upgrading to 8.4.4?