From: | "Arnau" <arnaulist(at)andromeiberica(dot)com> |
---|---|
To: | <pgsql-performance(at)postgresql(dot)org> |
Subject: | Queries with timestamps |
Date: | 2004-01-21 18:25:15 |
Message-ID: | 029701c3e04b$ea608930$3c0aa8c0@iberica.andromeiberica.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Hi all,
I'm quite newbie in SQL and I have a performance problem. I have the
following table (with some extra fields) and without any index:
CREATE TABLE STATISTICS
(
STATISTIC_ID NUMERIC(10) NOT NULL DEFAULT
nextval('STATISTIC_ID_SEQ')
CONSTRAINT pk_st_statistic_id
PRIMARY KEY,
TIMESTAMP_IN TIMESTAMP,
VALUE NUMERIC(10)
);
The queries on this table are mainly related with the timestamp field,
e.g.:
select * from statistics where time::date < current_date - interval
'1 month';
As the number of rows grows the time needed to execute this query takes
longer. What'd I should do improve the performance of this query?
Thank you very much
--
Arnau
From | Date | Subject | |
---|---|---|---|
Next Message | Bruno Wolff III | 2004-01-21 18:36:56 | Re: ORDER BY and LIMIT with SubSelects |
Previous Message | Ron St-Pierre | 2004-01-21 17:18:18 | ORDER BY and LIMIT with SubSelects |