Re: Interesting question

Поиск
Список
Период
Сортировка
От Larry Rosenman
Тема Re: Interesting question
Дата
Msg-id 20010519072147.A20410@lerami.lerctr.org
обсуждение исходный текст
Ответ на Re: Interesting question  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
* Tom Lane <tgl@sss.pgh.pa.us> [010518 22:39]:
> Larry Rosenman <ler@lerctr.org> writes:
> > CREATE FUNCTION "nowminus" (interval) RETURNS timestamp with time zone AS 'SELECT now() - $1;' LANGUAGE 'sql';
> 
> Right idea, but you need to mark it iscachable.
Aha:

Same query, with nowminus marked iscachable:
NOTICE:  QUERY PLAN:

Sort  (cost=513.69..513.69 rows=447 width=120) ->  Index Scan using start_index, end_index on attack_db
(cost=0.00..494.01rows=447 width=120)       SubPlan         ->  Seq Scan on exempt_ips  (cost=0.00..1.04 rows=4
width=12)        ->  Seq Scan on exempt_ips  (cost=0.00..1.04 rows=4 width=12)
 

EXPLAIN
> 
>             regards, tom lane


-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Plans for solving the VACUUM problem
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Plans for solving the VACUUM problem