Performance of UNION vs IN

Поиск
Список
Период
Сортировка
Искать
От
Jean-Max Reymond
Тема
Performance of UNION vs IN
Дата
Msg-id
532B1E05.70409@free.fr
Список
Дерево обсуждения
Performance of UNION vs IN Jean-Max Reymond <jmreymond@free.fr>
Re: Performance of UNION vs IN Torsten Förtsch <torsten.foertsch@gmx.net>
Re: Performance of UNION vs IN Jean-Max Reymond <jmreymond@free.fr>
I have a very complex view zinfoexp and running the view as:
SELECT * FROM zinfoexp  WHERE idmembre in (1,84)
take 2700 ms

So, I try another syntax:
SELECT * FROM zinfoexp  WHERE idmembre = 1
union
SELECT * FROM zinfoexp  WHERE idmembre = 84

and for me, two calls to my view takes a lot of time (may be x2) and it 
takes 134 ms !

How is it possible that the optimizer cannot optimize the IN as UNION ?
I have a database postgresql 9.3  freshly vacuumed

-- 
Jean-Max Reymond
CKR Solutions Open Source http://www.ckr-solutions.com

В списке pgsql-performance по дате отправления
От: Stefan Keller
Дата:
От: Tom Lane
Дата:
FAQ