Re: Add support for logging the current role

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Add support for logging the current role
Дата
Msg-id 17181.1295061359@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Add support for logging the current role  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: Add support for logging the current role  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
Stephen Frost <sfrost@snowman.net> writes:
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> In any case, if the GUC representation is a list of field names, I think
>> the POLA demands that the system honor the list order.  

> Agreed.  That puts us back into the question of how to make it
> efficient.  My best thought at the moment, which doesn't strike me as
> particularly efficient, is to build an array of the columns as enum's
> and then have loop through the array and use a switch() on the enum.

Yeah, an array or list of integer codes was what I was thinking too.

> At least it's all integer-based there then and we're not calling
> strcmp() for every field or strchr to find the next field, but
> couldn't we do better?

I really doubt that the cycles spent in the loop + switch are going to
amount to anything at all, compared to the cycles involved in formatting
each field and then pushing it through the CSV logic.  Not to mention
the I/O costs of sending the string somewhere afterwards.
        regards, tom lane


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

Предыдущее
От: Noah Misch
Дата:
Сообщение: Re: Snapshot synchronization, again...
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Add support for logging the current role