postgresql bug?

Started by uwcssaalmost 20 years ago2 messages
#1uwcssa
uwcssa@gmail.com

i am using version 8.0.3

if you run the following query:

select count(*) from T1 where (T1.a>10 and T1.a<20) or (T1.a>90 and T1.a
<100)

the set_baserel_size_estimate will accurately estimate the selectivity on
T1.

However, if you run

select count(*) from T1, T2 where T1.b=T2.c and (T1.a>10 and T1.a<20) or (
T1.a>90 and T1.a<100)

the selectivity estimate on T1 is always 1.0 the reason is the
re-l->baserestrictinfo is NULL for the second query in
set_baserel_size_estimates().

is this a bug?

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: uwcssa (#1)
Re: postgresql bug?

uwcssa <uwcssa@gmail.com> writes:

select count(*) from T1, T2 where T1.b=3DT2.c and (T1.a>10 and T1.a<20) or=
(
T1.a>90 and T1.a<100)

the selectivity estimate on T1 is always 1.0 the reason is the
re-l->baserestrictinfo is NULL for the second query in
set_baserel_size_estimates().

Sure you're not looking at T2?

regards, tom lane