Re: SQL help for efficient time handling..

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: SQL help for efficient time handling..
Дата
Msg-id 20030322081350.R1246-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на SQL help for efficient time handling..  (Rajesh Kumar Mallah <mallah@trade-india.com>)
Ответы Re: SQL help for efficient time handling..  (<mallah@trade-india.com>)
Список pgsql-sql
On Sat, 22 Mar 2003, Rajesh Kumar Mallah wrote:

> To get current_time_id  i use a query like
> SELECT  time_id from time_dimension where sql_time=date_trunc('minute' , cast(now() as time without time zone) );
>
> it works but uses seq_scan
> Seq Scan on time_dimension  (cost=0.00..35.00 rows=5 width=4) (actual time=4.75..8.16 rows=1 loops=1)
>    Filter: ((sql_time)::interval = date_trunc('minute'::text, ((now())::time without time zone)::interval))
>  Total runtime: 8.20 msec

How about something like:

select time_id from time_dimension where sql_time=cast(date_trunc('minute', now()) as time);



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ALTER TABLE does not raises WARNING/ERROR
Следующее
От:
Дата:
Сообщение: Re: SQL help for efficient time handling..