Re: pg_stat_statements

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: pg_stat_statements
Дата
Msg-id CANbhV-GQTFnCZHbReR6S6wVxnqg3VEC6r5kDMtXhfU4wE5vWyg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_stat_statements  (Julien Rouhaud <rjuju123@gmail.com>)
Ответы Re: pg_stat_statements  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-general
On Wed, 12 Jan 2022 at 03:03, Julien Rouhaud <rjuju123@gmail.com> wrote:
>
> Hi,
>
> On Tue, Jan 11, 2022 at 03:04:14PM +0000, Dirschel, Steve wrote:
> >
> > I'm not sure if this is the correct distribution list for this type of
> > question but I'll try anyways.  We have an app that uses multiple schemas.
> > It will do a set schema 'schema_name' and execute queries.  The queries
> > executed are the same regardless of the schema the connection set.
> >
> > In pg_stat_statements the exact same query will get a different queryid for
> > each schema that executes the query.
> >
> > I'm unable to determine which queryid comes from which schema the query was
> > executed under.  Is anyone aware of a way to determine this?
> >
>
> Unfortunately this is a known limitation.

I see this as a beneficial feature.

If the same SQL is executed against different sets of tables, each
with different indexes, probably different data, the performance could
vary dramatically and might need different tuning on each. So having
separate rows in the pg_stat_statements output makes sense.

> There were some previous discussions (e.g. [1] and [2] more recently), but I
> don't think there was a real consensus on how to solve that problem.

To differentiate, run each schema using a different user, so you can
tell them apart.

-- 
Simon Riggs                http://www.EnterpriseDB.com/



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

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: pg_stat_statements
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: pg_stat_statements