pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: In pg_dump, avoid doing per-table queries for RLS policies.
7+ messages / 1 participants
[nested] [flat]

* pgsql: In pg_dump, avoid doing per-table queries for RLS policies.
@ 2021-08-31 19:04  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-08-31 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In pg_dump, avoid doing per-table queries for RLS policies.

For no particularly good reason, getPolicies() queried pg_policy
separately for each table.  We can collect all the policies in
a single query instead, and attach them to the correct TableInfo
objects using findTableByOid() lookups.  On the regression
database, this reduces the number of queries substantially, and
provides a visible savings even when running against a local
server.

Per complaint from Hubert Depesz Lubaczewski.  Since this is such
a simple fix and can have a visible performance benefit, back-patch
to all supported branches.

Discussion: https://postgr.es/m/20210826084430.GA26282@depesz.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bd3611db5a6f3726094872f59feab426374d2c46

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 92 ++++++++++++++++++++++-------------------------
1 file changed, 42 insertions(+), 50 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: In pg_dump, avoid doing per-table queries for RLS policies.
@ 2021-08-31 19:04  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-08-31 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In pg_dump, avoid doing per-table queries for RLS policies.

For no particularly good reason, getPolicies() queried pg_policy
separately for each table.  We can collect all the policies in
a single query instead, and attach them to the correct TableInfo
objects using findTableByOid() lookups.  On the regression
database, this reduces the number of queries substantially, and
provides a visible savings even when running against a local
server.

Per complaint from Hubert Depesz Lubaczewski.  Since this is such
a simple fix and can have a visible performance benefit, back-patch
to all supported branches.

Discussion: https://postgr.es/m/20210826084430.GA26282@depesz.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a60860ff33fbd41685943e1c59a199fe95ee96bd

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 95 +++++++++++++++++++++--------------------------
1 file changed, 43 insertions(+), 52 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: In pg_dump, avoid doing per-table queries for RLS policies.
@ 2021-08-31 19:04  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-08-31 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In pg_dump, avoid doing per-table queries for RLS policies.

For no particularly good reason, getPolicies() queried pg_policy
separately for each table.  We can collect all the policies in
a single query instead, and attach them to the correct TableInfo
objects using findTableByOid() lookups.  On the regression
database, this reduces the number of queries substantially, and
provides a visible savings even when running against a local
server.

Per complaint from Hubert Depesz Lubaczewski.  Since this is such
a simple fix and can have a visible performance benefit, back-patch
to all supported branches.

Discussion: https://postgr.es/m/20210826084430.GA26282@depesz.com

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/dd3105286bd8c0ade31961cb5a585692c73bca6f

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 79 +++++++++++++++++++++++------------------------
1 file changed, 38 insertions(+), 41 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: In pg_dump, avoid doing per-table queries for RLS policies.
@ 2021-08-31 19:04  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-08-31 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In pg_dump, avoid doing per-table queries for RLS policies.

For no particularly good reason, getPolicies() queried pg_policy
separately for each table.  We can collect all the policies in
a single query instead, and attach them to the correct TableInfo
objects using findTableByOid() lookups.  On the regression
database, this reduces the number of queries substantially, and
provides a visible savings even when running against a local
server.

Per complaint from Hubert Depesz Lubaczewski.  Since this is such
a simple fix and can have a visible performance benefit, back-patch
to all supported branches.

Discussion: https://postgr.es/m/20210826084430.GA26282@depesz.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/db11b4a3db5f6613c844c1b3a6c203bbceb05532

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 92 ++++++++++++++++++++++-------------------------
1 file changed, 42 insertions(+), 50 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: In pg_dump, avoid doing per-table queries for RLS policies.
@ 2021-08-31 19:04  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-08-31 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In pg_dump, avoid doing per-table queries for RLS policies.

For no particularly good reason, getPolicies() queried pg_policy
separately for each table.  We can collect all the policies in
a single query instead, and attach them to the correct TableInfo
objects using findTableByOid() lookups.  On the regression
database, this reduces the number of queries substantially, and
provides a visible savings even when running against a local
server.

Per complaint from Hubert Depesz Lubaczewski.  Since this is such
a simple fix and can have a visible performance benefit, back-patch
to all supported branches.

Discussion: https://postgr.es/m/20210826084430.GA26282@depesz.com

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6b9667392d815caea3c3bd138d360f0d321f9c36

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 92 ++++++++++++++++++++++-------------------------
1 file changed, 42 insertions(+), 50 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: In pg_dump, avoid doing per-table queries for RLS policies.
@ 2021-08-31 19:04  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-08-31 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In pg_dump, avoid doing per-table queries for RLS policies.

For no particularly good reason, getPolicies() queried pg_policy
separately for each table.  We can collect all the policies in
a single query instead, and attach them to the correct TableInfo
objects using findTableByOid() lookups.  On the regression
database, this reduces the number of queries substantially, and
provides a visible savings even when running against a local
server.

Per complaint from Hubert Depesz Lubaczewski.  Since this is such
a simple fix and can have a visible performance benefit, back-patch
to all supported branches.

Discussion: https://postgr.es/m/20210826084430.GA26282@depesz.com

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ba8f1a0be5833338ddbf1cea3427f6baace3f4c8

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 95 +++++++++++++++++++++--------------------------
1 file changed, 43 insertions(+), 52 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: In pg_dump, avoid doing per-table queries for RLS policies.
@ 2021-08-31 19:04  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-08-31 19:04 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In pg_dump, avoid doing per-table queries for RLS policies.

For no particularly good reason, getPolicies() queried pg_policy
separately for each table.  We can collect all the policies in
a single query instead, and attach them to the correct TableInfo
objects using findTableByOid() lookups.  On the regression
database, this reduces the number of queries substantially, and
provides a visible savings even when running against a local
server.

Per complaint from Hubert Depesz Lubaczewski.  Since this is such
a simple fix and can have a visible performance benefit, back-patch
to all supported branches.

Discussion: https://postgr.es/m/20210826084430.GA26282@depesz.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a20a9f26cefcf4e35ba7bb3d9e8672cb4ce1cf32

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 92 ++++++++++++++++++++++-------------------------
1 file changed, 42 insertions(+), 50 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2021-08-31 19:04 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31 19:04 pgsql: In pg_dump, avoid doing per-table queries for RLS policies. Tom Lane <tgl@sss.pgh.pa.us>
2021-08-31 19:04 pgsql: In pg_dump, avoid doing per-table queries for RLS policies. Tom Lane <tgl@sss.pgh.pa.us>
2021-08-31 19:04 pgsql: In pg_dump, avoid doing per-table queries for RLS policies. Tom Lane <tgl@sss.pgh.pa.us>
2021-08-31 19:04 pgsql: In pg_dump, avoid doing per-table queries for RLS policies. Tom Lane <tgl@sss.pgh.pa.us>
2021-08-31 19:04 pgsql: In pg_dump, avoid doing per-table queries for RLS policies. Tom Lane <tgl@sss.pgh.pa.us>
2021-08-31 19:04 pgsql: In pg_dump, avoid doing per-table queries for RLS policies. Tom Lane <tgl@sss.pgh.pa.us>
2021-08-31 19:04 pgsql: In pg_dump, avoid doing per-table queries for RLS policies. Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox