Re: multiple table scan performance

Поиск
Список
Период
Сортировка
От Craig James
Тема Re: multiple table scan performance
Дата
Msg-id 4D926BCE.8000001@emolecules.com
обсуждение исходный текст
Ответ на multiple table scan performance  (Samuel Gendler <sgendler@ideasculptor.com>)
Список pgsql-performance
On 3/29/11 3:16 PM, Samuel Gendler wrote:
> I've got some functionality that necessarily must scan a relatively large table.  Even worse, the total workload is
actually3 similar, but different queries, each of which requires a table scan.  They all have a resultset that has the
samestructure, and all get inserted into a temp table.  Is there any performance benefit to revamping the workload such
thatit issues a single: 
>
> insert into (...) select ... UNION select ... UNION select
>
> as opposed to 3 separate "insert into () select ..." statements.
>
> I could figure it out empirically, but the queries are really slow on my dev laptop and I don't have access to the
stagingsystem at the moment.  Also, it requires revamping a fair bit of code, so I figured it never hurts to ask.  I
don'thave a sense of whether postgres is able to parallelize multiple subqueries via a single scan 
You don't indicate how complex your queries are.  If it's just a single table and the conditions are relatively simple,
couldyou do something like this? 

   insert into (...) select ... where (...) OR (...) OR (...)

Craig

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

Предыдущее
От: Samuel Gendler
Дата:
Сообщение: Re: multiple table scan performance
Следующее
От: Lars Feistner
Дата:
Сообщение: Re: very long updates very small tables