Re: optimizing large query with IN (...)

Поиск
Список
Период
Сортировка
От Marcus Andree S. Magalhaes
Тема Re: optimizing large query with IN (...)
Дата
Msg-id 63139.200.174.148.100.1078938143.squirrel@webmail.webnow.com.br
обсуждение исходный текст
Ответ на optimizing large query with IN (...)  ("Marcus Andree S. Magalhaes" <marcus.magalhaes@vlinfo.com.br>)
Ответы Re: optimizing large query with IN (...)  ("scott.marlowe" <scott.marlowe@ihs.com>)
Re: optimizing large query with IN (...)  (Steve Atkins <steve@blighty.com>)
Список pgsql-performance
Hmm... from the 'performance' point of view, since the data comes from
a quite complex select statement, Isn't it better/quicker to have this
select replaced by a select into and creating a temporary database?



> The problem, as I understand it, is that 7.4 introduced massive
> improvements in handling moderately large in() clauses, as long as they
> can fit in sort_mem, and are provided by a subselect.
>
> So, creating a temp table with all the values in it and using in() on
> the  temp table may be a win:
>
> begin;
> create temp table t_ids(id int);
> insert into t_ids(id) values (123); <- repeat a few hundred times
> select * from maintable where id in (select id from t_ids);
> ...




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

Предыдущее
От: Greg Spiegelberg
Дата:
Сообщение: Re: [ADMIN] syslog slowing the database?
Следующее
От: "scott.marlowe"
Дата:
Сообщение: Re: optimizing large query with IN (...)