Re: database performance and query performance question - Mailing list pgsql-performance

From Hannu Krosing
Subject Re: database performance and query performance question
Date
Msg-id 1074814717.2592.8.camel@fuji.krosing.net
Whole thread Raw
In response to Re: database performance and query performance question  ("Shea,Dan [CIS]" <Dan.Shea@ec.gc.ca>)
List pgsql-performance
Shea,Dan [CIS] kirjutas N, 22.01.2004 kell 23:32:
> The end date in the previous example was actually invalid  between
> '2004-01-12'::date and '2003-01-12'::date;
> There have been multiple inserts since I recreated the index but it took
> quite some time to complete the following
> PWFPM_DEV=# explain analyze select * from forecastelement where valid_time
> between '2004-01-12'::date and '2004-01-13'::date;

You could try ORDER BY to bias the optimiser towards using an index:

explain analyze
 select *
  from forecastelement
 where valid_time > '2004-01-12'::date
 order by valid_time
 limit 10;

This also may be more close to what you are expecting :)

------------------
Hannu


pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: database performance and query performance question
Next
From: Greg Stark
Date:
Subject: Re: database performance and query performance question