Re: weird query runtime results... - Mailing list pgsql-general

From Tomasz Ostrowski
Subject Re: weird query runtime results...
Date
Msg-id 48C62004.70904@batory.org.pl
Whole thread Raw
In response to weird query runtime results...  (Kashmir <kashmir_us_1999@yahoo.com>)
List pgsql-general
On 2008-09-09 05:07, Kashmir wrote:

> querying data from august 1st - august 25:
>  Total runtime: 26762.999 ms
>
> now querying data from august 1st - august 29:
>  Total runtime: 20123.584 ms
>
> Any idea why these analysises look so different? the only
> query-difference is the 2nd timestamp value, it is a little higher in
> the 2nd query...

Did you realize that this second query returns over 6 seconds faster
than first?

If you query a significant portion of data a table scan is faster than
using indexes as a drive does not need to seek that much.

You can control when it will switch to seq-scan tuning
seq_page_cost/random_page_cost parameters in postgresql.conf. But test
also other queries common for your usage.

Regards
Tometzky
--
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
                                                      Winnie the Pooh

pgsql-general by date:

Previous
From: "Mohd Fahadullah"
Date:
Subject: Server installation problem using freebsd ports
Next
From: Tomasz Ostrowski
Date:
Subject: Re: 8.3 on FreeBSD 6.3, sudden performance degradations