Re: again on index usage

Поиск
Список
Период
Сортировка
От Sean Chittenden
Тема Re: again on index usage
Дата
Msg-id 20020107175321.C67695@ninja1.internal
обсуждение исходный текст
Ответ на Re: again on index usage  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> It's difficult to tell from this what it thinks the selectivity of the
> ipdate index would be, since the rows estimate includes the effect of
> the ipaddr and router restrictions.  What do you get from just
> 
> explain
> SELECT sum(input) FROM iplog_gate200112 
> WHERE 
>   '2001-12-01 00:00:00+02' <= ipdate AND ipdate < '2001-12-02 00:00:00+02' AND 
>   '2001-12-01 00:00:00+02' <= ipdate AND ipdate < '2002-01-01 00:00:00+02';
> 

I don't know if this'd help, but if you're suming the data and running
this query often, see if a function index would help:

CREATE INDEX sum_input_fnc_idx ON iplog_gate200112 (sum(input));

-sc

-- 
Sean Chittenden


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ecpg compile error on AIX
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: ecpg compile error on AIX