Re: distinct estimate of a hard-coded VALUES list

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: distinct estimate of a hard-coded VALUES list
Дата
Msg-id 28817.1471897475@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: distinct estimate of a hard-coded VALUES list  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Sat, Aug 20, 2016 at 4:58 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I am not exactly sold on this assumption that applications have
>> de-duplicated the contents of a VALUES or IN list.  They haven't been
>> asked to do that in the past, so why do you think they are doing it?

> It's hard to know, but my intuition is that most people would
> deduplicate.  I mean, nobody is going to want to their query generator
> to send X IN (1, 1, <repeat a zillion more times>) to the server if it
> could have just sent X IN (1).

I dunno, these are the very same people who send "WHERE 1=1" so that
they can save one line of code to decide whether to append AND or not
before the first real condition.

Still, maybe we should optimize for smart queries rather than stupid
ones.
        regards, tom lane



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Bug in abbreviated keys abort handling (found with amcheck)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: New SQL counter statistics view (pg_stat_sql)