Re: query from partitions

Поиск
Список
Период
Сортировка
От Steinar H. Gunderson
Тема Re: query from partitions
Дата
Msg-id 20051213160852.GA3740@uio.no
обсуждение исходный текст
Ответ на query from partitions  (Ключников А.С. <alexs@analytic.mv.ru>)
Список pgsql-performance
On Tue, Dec 13, 2005 at 06:18:19PM +0300, Ключников А.С. wrote:
> select * from base
>     where id in (select id from device where id = 1 or id = 2) and
>     datatime between '2005-05-15' and '2005-05-17';
> 10 minits

That's a really odd way of saying "1 or 2". It probably has to go through all
the records in device, not realizing it can just scan for two of them (using
two index scans). I'd guess an EXPLAIN ANALYZE would confirm something like
this happening (you'd want to run that and post the results here anyhow).

/* Steinar */
--
Homepage: http://www.sesse.net/

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: query from partitions
Следующее
От: Francisco Reyes
Дата:
Сообщение: Re: Small table or partial index?