projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb951bc
)
Dept of second thoughts: the IQ of estimate_array_length() needs to be
author
Tom Lane
<tgl@sss.pgh.pa.us>
Sun, 28 Jan 2007 02:53:42 +0000
(
02:53
+0000)
committer
Tom Lane
<tgl@sss.pgh.pa.us>
Sun, 28 Jan 2007 02:53:42 +0000
(
02:53
+0000)
kept on par with that of scalararraysel(), else estimates that should
track might not. Hence teach it about binary-compatible cases, too.
src/backend/utils/adt/selfuncs.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/utils/adt/selfuncs.c
b/src/backend/utils/adt/selfuncs.c
index a56a2c24728b65c25547435285eb22e3e3e48d9b..94cb8ab6f17336e72ae5e69980c788263016c506 100644
(file)
--- a/
src/backend/utils/adt/selfuncs.c
+++ b/
src/backend/utils/adt/selfuncs.c
@@
-1700,6
+1700,9
@@
scalararraysel(PlannerInfo *root,
int
estimate_array_length(Node *arrayexpr)
{
+ /* look through any binary-compatible relabeling of arrayexpr */
+ arrayexpr = strip_array_coercion(arrayexpr);
+
if (arrayexpr && IsA(arrayexpr, Const))
{
Datum arraydatum = ((Const *) arrayexpr)->constvalue;