Re: WIP Patch: Use sortedness of CSV foreign tables for query planning

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: WIP Patch: Use sortedness of CSV foreign tables for query planning
Дата
Msg-id 9700.1344263586@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: WIP Patch: Use sortedness of CSV foreign tables for query planning  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: WIP Patch: Use sortedness of CSV foreign tables for query planning
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Sun, Aug 5, 2012 at 10:41 PM, Etsuro Fujita
> <fujita.etsuro@lab.ntt.co.jp> wrote:
>> I think file_fdw is useful for managing log files such as PG CSV logs.  Since
>> often, such files are sorted by timestamp, I think the patch can improve the
>> performance of log analysis, though I have to admit my demonstration was not
>> realistic.

> Hmm, I guess I could buy that as a plausible use case.

In the particular case of PG log files, I'd bet good money against them
being *exactly* sorted by timestamp.  Clock skew between backends, or
varying amounts of time to construct and send messages, will result in
small inconsistencies.  This would generally not matter, until the
planner relied on the claim of sortedness for something like a mergejoin
... and then it would matter a lot.

In general I'm quite suspicious of the idea of believing that externally
supplied data is sorted in exactly the way that PG thinks it should
sort.  If we implement this you can bet that people will screw up, for
instance by using the wrong locale/collation to sort text data.
        regards, tom lane


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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: tzdata2012d
Следующее
От: Robert Haas
Дата:
Сообщение: Re: WIP patch for LATERAL subqueries