Re: SQL Normalization Thought

Поиск
Список
Период
Сортировка
От dennis jenkins
Тема Re: SQL Normalization Thought
Дата
Msg-id CAAEzAp9n3bDyOYV=o6L-d9pKcJVzjedbaw_DusqfxSZA5HhGKw@mail.gmail.com
обсуждение исходный текст
Ответ на SQL Normalization Thought  (David Johnston <polobo@yahoo.com>)
Список pgsql-general
On Wed, Mar 7, 2012 at 6:34 AM, David Johnston <polobo@yahoo.com> wrote:
> I know there is currently work ongoing regarding normalizing SQL statements for logging purposes but has anyone
consideredgiven us the ability to name our statements. 
>
> SELECT ....
> FROM ...
> WHERE ....
> NAMEAS 'Name to track by'
>
> If a query lacks a name the algorithm generated normalized form would be used instead but otherwise all queries with
thesame name would be treated as being the same for statistics purposes. 
>
> I'm sure there is more to it but the idea of letting the user name their queries, and thus have something to actually
linkthe logs and the source code directly, has merit and at the least provides a workaround to an algorithmic routine. 
>

You could place a 'C style' comment at the beginning of the statement.  Ex:

/* MagicQuery-001 */ select awsome_stuff from coolness_table where user_id=?;

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

Предыдущее
От:
Дата:
Сообщение: Re: ERROR: could not find tuple for trigger 37463634
Следующее
От: Martin Gregorie
Дата:
Сообщение: Fixing the loss of 'template1'