Re: Add support for logging the current role - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add support for logging the current role
Date
Msg-id 17181.1295061359@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add support for logging the current role  (Stephen Frost <sfrost@snowman.net>)
Responses Re: Add support for logging the current role  (Stephen Frost <sfrost@snowman.net>)
List 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 by date:

Previous
From: Noah Misch
Date:
Subject: Re: Snapshot synchronization, again...
Next
From: Stephen Frost
Date:
Subject: Re: Add support for logging the current role