pgsql: Prevent synchronized scanning when systable_beginscan chooses a

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Prevent synchronized scanning when systable_beginscan chooses a
Date: 2012-05-26 23:10:52
Message-ID: E1SYQ8K-0006uI-Um@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Prevent synchronized scanning when systable_beginscan chooses a heapscan.

The only interesting-for-performance case wherein we force heapscan here
is when we're rebuilding the relcache init file, and the only such case
that is likely to be examining a catalog big enough to be syncscanned is
RelationBuildTupleDesc. But the early-exit optimization in that code gets
broken if we start the scan at a random place within the catalog, so that
allowing syncscan is actually a big deoptimization if pg_attribute is large
(at least for the normal case where the rows for core system catalogs have
never been changed since initdb). Hence, prevent syncscan here. Per my
testing pursuant to complaints from Jeff Frost and Greg Sabino Mullane,
though neither of them seem to have actually hit this specific problem.

Back-patch to 8.3, where syncscan was introduced.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2ce097e6e8989028ce18fdca010351b8fcc9dfd0

Modified Files
--------------
src/backend/access/index/genam.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2012-05-26 23:10:53 pgsql: Prevent synchronized scanning when systable_beginscan chooses a
Previous Message Tom Lane 2012-05-25 21:35:55 pgsql: Fix string truncation to be multibyte-aware in text_name and bpc