diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-02-11 15:23:52 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-02-11 15:23:52 -0500 |
commit | b6f869beeab06981c223ff35088fdb8a5422584d (patch) | |
tree | 3290125dcdf3722a03f6573aaafb1028f2802a80 /src/test/regress/sql/gist.sql | |
parent | 34523933b8dc118da0693d55a3b01e9d02be0949 (diff) |
Don't use_physical_tlist for an IOS with non-returnable columns.
createplan.c tries to save a runtime projection step by specifying
a scan plan node's output as being exactly the table's columns, or
index's columns in the case of an index-only scan, if there is not a
reason to do otherwise. This logic did not previously pay attention
to whether an index's columns are returnable. That worked, sort of
accidentally, until commit 9a3ddeb51 taught setrefs.c to reject plans
that try to read a non-returnable column. I have no desire to loosen
setrefs.c's new check, so instead adjust use_physical_tlist() to not
try to optimize this way when there are non-returnable column(s).
Per report from Ryan Kelly. Like the previous patch, back-patch
to all supported branches.
Discussion: https://postgr.es/m/CAHUie24ddN+pDNw7fkhNrjrwAX=fXXfGZZEHhRuofV_N_ftaSg@mail.gmail.com
Diffstat (limited to 'src/test/regress/sql/gist.sql')
-rw-r--r-- | src/test/regress/sql/gist.sql | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/regress/sql/gist.sql b/src/test/regress/sql/gist.sql index 487791bc812..011f15bca01 100644 --- a/src/test/regress/sql/gist.sql +++ b/src/test/regress/sql/gist.sql @@ -131,6 +131,11 @@ explain (verbose, costs off) select p from gist_tbl where circle(p,1) @> circle(point(0,0),0.95); select p from gist_tbl where circle(p,1) @> circle(point(0,0),0.95); +-- Also check that use_physical_tlist doesn't trigger in such cases. +explain (verbose, costs off) +select count(*) from gist_tbl; +select count(*) from gist_tbl; + -- This case isn't supported, but it should at least EXPLAIN correctly. explain (verbose, costs off) select p from gist_tbl order by circle(p,1) <-> point(0,0) limit 1; |