Re: Query tuning

From: Віталій Тимчишин <tivv00(at)gmail(dot)com>
To: Kevin Kempter <kevink(at)consistentstate(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query tuning
Date: 2009-08-20 12:03:07
Message-ID: 331e40660908200503o1a24aa42pb25210fb59691f88@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

2009/8/19 Kevin Kempter <kevink(at)consistentstate(dot)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?

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Ivan Voras 2009-08-20 12:50:23 Re: PG 8.3 and server load
Previous Message Fabio La Farcioli 2009-08-20 08:35:19 Re: Number of tables