Re: [HACKERS] BUG: pg_stat_statements query normalization issues with combined queries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] BUG: pg_stat_statements query normalization issues with combined queries
Дата
Msg-id 26942.1482862983@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] BUG: pg_stat_statements query normalization issueswith combined queries  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: [HACKERS] BUG: pg_stat_statements query normalization issueswith combined queries  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-hackers
Fabien COELHO <coelho@cri.ensmp.fr> writes:
> How? The issue is that stmtmulti silently skip some ';' when empty 
> statements are found, so I need to keep track of that to know where to 
> stop, using the beginning location of the next statement, which is 
> probably your idea, does not work.

Maybe you should undo that.  I've generally found that trying to put
optimizations into the grammar is a bad idea; it's better to KISS in
gram.y and apply optimizations later on.

>> - Make all parse nodes have the following two members at the
>> beginning. This unifies all parse node from the view of setting
>> their location. Commenting about this would be better.
>> 
>> | NodeTag   type;
>> | int       location;

I do not like this.  You are making what should be a small patch into
a giant, invasive one.  I'd think about adding a single parse node type
that corresponds to "stmt" in the grammar and really doesn't do anything
but carry the location info for the overall statement.  That info could
then be transferred into the resulting Query node.  Problem solved with
(I think) very little code touched.
        regards, tom lane



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

Предыдущее
От: David Fetter
Дата:
Сообщение: [HACKERS] Hooks
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Hooks