diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-11-15 02:45:35 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-11-15 02:45:35 +0000 |
commit | caf9c830d9d1180ab693f8a6eb205f5862174158 (patch) | |
tree | a9a6d4d79bedc2a62e87cd7eeea1bffa18e1836b /src/backend/optimizer/path/allpaths.c | |
parent | 29faadcd2780f74550d6a983a81bc6bad3967bd6 (diff) | |
download | postgresql-caf9c830d9d1180ab693f8a6eb205f5862174158.tar.gz postgresql-caf9c830d9d1180ab693f8a6eb205f5862174158.zip |
Improve planning of Materialize nodes inserted atop the inner input of a
mergejoin to shield it from doing mark/restore and refetches. Put an explicit
flag in MergePath so we can centralize the logic that knows about this,
and add costing logic that considers using Materialize even when it's not
forced by the previously-existing considerations. This is in response to
a discussion back in August that suggested that materializing an inner
indexscan can be helpful when the refetch percentage is high enough.
Diffstat (limited to 'src/backend/optimizer/path/allpaths.c')
-rw-r--r-- | src/backend/optimizer/path/allpaths.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 4d402ca7202..c225d7e2887 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.188 2009/10/26 02:26:33 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.189 2009/11/15 02:45:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1443,13 +1443,12 @@ print_path(PlannerInfo *root, Path *path, int indent) { MergePath *mp = (MergePath *) path; - if (mp->outersortkeys || mp->innersortkeys) - { - for (i = 0; i < indent; i++) - printf("\t"); - printf(" sortouter=%d sortinner=%d\n", - ((mp->outersortkeys) ? 1 : 0), - ((mp->innersortkeys) ? 1 : 0)); + for (i = 0; i < indent; i++) + printf("\t"); + printf(" sortouter=%d sortinner=%d materializeinner=%d\n", + ((mp->outersortkeys) ? 1 : 0), + ((mp->innersortkeys) ? 1 : 0), + ((mp->materialize_inner) ? 1 : 0)); } } |