Skip site navigation (1) Skip section navigation (2)

pgsql: Tweak ExecIndexEvalRuntimeKeys to forcibly detoast any toasted

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Tweak ExecIndexEvalRuntimeKeys to forcibly detoast any toasted
Date: 2009-08-23 18:26:15
Message-ID: 20090823182615.9C56A75331E@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Tweak ExecIndexEvalRuntimeKeys to forcibly detoast any toasted comparison
values before they get passed to the index access method.  This avoids
repeated detoastings that will otherwise ensue as the comparison value
is examined by various index support functions.  We have seen a couple of
reports of cases where repeated detoastings result in an order-of-magnitude
slowdown, so it seems worth adding a bit of extra logic to prevent this.

I had previously proposed trying to avoid duplicate detoastings in general,
but this fix takes care of what seems the most important case in practice
with very little effort or risk.

Back-patch to 8.4 so that the PostGIS folk won't have to wait a year to
have this fix in a production release.  (The issue exists further back,
of course, but the code's diverged enough to make backpatching further a
higher-risk action.  Also it appears that the possible gains may be limited
in prior releases because of different handling of lossy operators.)

Tags:
----
REL8_4_STABLE

Modified Files:
--------------
    pgsql/src/backend/executor:
        nodeIndexscan.c (r1.132.2.1 -> r1.132.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeIndexscan.c?r1=1.132.2.1&r2=1.132.2.2)
    pgsql/src/include/nodes:
        execnodes.h (r1.205 -> r1.205.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/execnodes.h?r1=1.205&r2=1.205.2.1)

pgsql-committers by date

Next:From: Tom LaneDate: 2009-08-23 19:23:41
Subject: pgsql: Make TRUNCATE do truncate-in-place when processing a relation
Previous:From: Tom LaneDate: 2009-08-23 18:26:08
Subject: pgsql: Tweak ExecIndexEvalRuntimeKeys to forcibly detoast any toasted

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group