Re: Typmod associated with multi-row VALUES constructs

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Typmod associated with multi-row VALUES constructs
Дата
Msg-id CAKFQuwZ7RbLMbB4bzCY9JsGLWJJrFCGqY+91HMcjtj3cEugz0g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Typmod associated with multi-row VALUES constructs  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
On Mon, Dec 5, 2016 at 9:54 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
 The concern is that "scan every row" could be very expensive - though in writing this I'm thinking that you'd quickly find a non-match even in a large dataset - and so a less perfect but still valid solution is to simply discard the typemod if there is more than one row. 

​My folly here - and the actual question to ask - is if you are faced with large dataset that does have consistent typmods - is the benefit of knowing what it is and carrying it to the next layer worth the cost of scanning every single row to prove it is consistent?​

My vote would be no - and the only question to ask is whether n = 1 and n > 1 behaviors should differ - to which I'd say no as well - at least in master.  In the back branches the current behavior would be retained if the n = 1 behavior is kept different than the n > 1 behavior which is a worthy trade-off.

David J.

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Adding in docs the meaning of pg_stat_replication.sync_state
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: PSQL commands: \quit_if, \quit_unless