Re: need to speed up query

From: "Gregory Williamson" <Gregory(dot)Williamson(at)digitalglobe(dot)com>
To: "Justin" <justin(at)emproshunts(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: need to speed up query
Date: 2008-05-06 04:08:35
Message-ID: 8B319E5A30FF4A48BE7EEAAF609DB233015E3832@COMAIL01.digitalglobe.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Justin --

You wrote:
>
> i've had to write queries to get trail balance values out of the GL
> transaction table and i'm not happy with its performance
>
>
> The table has 76K rows growing about 1000 rows per working day so the
> performance is not that great it takes about 20 to 30 seconds to get all
> the records for the table and when we limit it to single accounting
> period it drops down to 2 seconds

So 30 seconds for 76 days (roughly) worth of numbers ? Not terrible but not great.

> Here is the query and explain . PostgreSql is 8.3.1 on new server with
> raid 10 Serial SCSI.
<... snipped 'cause I have a lame reader ...>

> " Sort Method: quicksort Memory: 292kB"
<...snip...>
> "Total runtime: 24682.580 ms"

I don't have any immediate thoughts but maybe you could post the table schemas and indexes. It looks to my untutored eye as if most of the estimates are fair so I am guessing that you have run analyze recently.

What is your sort memory set to ? If work_mem is too low then you'll go to disk (if you see tmp files under the postgres $PGDATA/base directory you might be seeing the result of this) ...

HTH

Greg Williamson
Senior DBA
DigitalGlobe

Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information and must be protected in accordance with those provisions. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

(My corporate masters made me say this.)

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Justin 2008-05-06 05:36:36 Re: need to speed up query
Previous Message Greg Smith 2008-05-06 03:59:30 Re: RAID 10 Benchmark with different I/O schedulers (was: Performance increase with elevator=deadline)