Re: Convert coalesce to or/and

Поиск
Список
Период
Сортировка
От Nicolas Adenis-Lamarre
Тема Re: Convert coalesce to or/and
Дата
Msg-id CACPGbctvagRdjq0EUvj2kmoZ52c50zz1-gKhb_gexN1tBCuaXQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Convert coalesce to or/and  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Convert coalesce to or/and
Список pgsql-hackers
I attached a patch proposition.

explain analyze
select *
from people p
where coalesce(firstname, lastname) = 'Louis'
-- before: Seq Scan on people p (cost=0.00..4015.04 rows=732
width=321) (actual time=0.019..11.217 rows=3856.00 loops=1)
-- after: Seq Scan on people p (cost=0.00..4015.04 rows=3872
width=177) (actual time=0.026..13.730 rows=3856.00 loops=1)

explain analyze
select *
from people p
where firstname = 'Louis' or (firstname is null and lastname = 'Louis')
-- Seq Scan on people p (cost=0.00..4381.24 rows=3872 width=177)
(actual time=0.016..14.899 rows=3856.00 loops=1)



Nicolas

Вложения

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