pg_stat_statements query normalization, and the 'in' operator

From: unixway(dot)drive(at)gmail(dot)com
To: pgsql-hackers(at)postgresql(dot)org
Subject: pg_stat_statements query normalization, and the 'in' operator
Date: 2017-08-12 01:33:36
Message-ID: 4c3140e8-110a-3038-0879-c14e8afdf72b@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello there,

Given the following list of queries:

create table foo (id serial, bar integer);
select * from foo where id in (1);
select * from foo where id in (2,3);
select * from foo where id in (1,3,5);
select * from foo where id in (select id from foo);

would it be possible to have first three select queries to be normalized
into a single one so that 'select query from pg_stat_statements' returns
something like:

select * from foo where id in (...);
select * from foo where id in (select id from foo);
(2 rows)

instead of:

select * from foo where id in (?,?);
select * from foo where id in (?,?,?);
select * from foo where id in (?);
select * from foo where id in (select id from foo);
(4 rows)

?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-08-12 01:55:04 Re: POC: Sharing record typmods between backends
Previous Message Peter Eisentraut 2017-08-12 01:20:37 additional contrib test suites