Re: Query tuning - Mailing list pgsql-performance

From Віталій Тимчишин
Subject Re: Query tuning
Date
Msg-id 331e40660908200503o1a24aa42pb25210fb59691f88@mail.gmail.com
Whole thread Raw
In response to Re: Query tuning  (Kevin Kempter <kevink@consistentstate.com>)
List pgsql-performance


2009/8/19 Kevin Kempter <kevink@consistentstate.com>

We do have an index on url_hits.time

not sure why timestamps were not used, I was not here for the design phase.

What's type of time column? I don't like it casts it to double in explain. If it is integer, may be you need to change

and time >= extract ('epoch' from timestamp '2009-08-12')
and time < extract ('epoch' from timestamp '2009-08-13' )

to

and time >= extract ('epoch' from timestamp '2009-08-12')::int4
and time < extract ('epoch' from timestamp '2009-08-13' )::int4

for the index to be used?

pgsql-performance by date:

Previous
From: Fabio La Farcioli
Date:
Subject: Re: Number of tables
Next
From: Ivan Voras
Date:
Subject: Re: PG 8.3 and server load