Queries with timestamps

Поиск
Список
Период
Сортировка
От Arnau
Тема Queries with timestamps
Дата
Msg-id 029701c3e04b$ea608930$3c0aa8c0@iberica.andromeiberica.com
обсуждение исходный текст
Ответы Re: Queries with timestamps  (Josh Berkus <josh@agliodbs.com>)
Список 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



В списке pgsql-performance по дате отправления:

Предыдущее
От: Ron St-Pierre
Дата:
Сообщение: ORDER BY and LIMIT with SubSelects
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: ORDER BY and LIMIT with SubSelects