Re: [PERFORM] Slow execution time when querying view with WHERE clause

2004-11-24 Thread Mike Mascari
Tom Lane wrote: Um ... doh ... analyze.c about line 1550: /* We can only compute valid stats if we found some non-null values. */ if (nonnull_cnt > 0) ... There's a bit of an epistemological issue here: if we didn't actually find any nonnull values in our sample, is it legitimate to

Re: [PERFORM] Slow execution time when querying view with WHERE clause

2004-11-23 Thread Tom Lane
Mike Mascari <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Why is it so completely off about the selectivity of the IS NULL clause? > I think this is a bug in ANALYZE not constructing statistics for columns > whose data is entirely NULL: Um ... doh ... analyze.c about line 1550: /* We ca

Re: [PERFORM] Slow execution time when querying view with WHERE clause

2004-11-23 Thread Tom Lane
Jaime Casanova <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Why is it so completely off about the selectivity >> of the IS NULL clause? > null values are not indexable, is that your question? Uh, no. The problem is that the IS NULL condition matched all 48 rows of the table, but the planner

Re: [PERFORM] Slow execution time when querying view with WHERE clause

2004-11-23 Thread Jaime Casanova
--- Mike Mascari <[EMAIL PROTECTED]> escribió: > Tom Lane wrote: > > Mike Mascari <[EMAIL PROTECTED]> writes: > > > >>When I query the view with a simple filter, I get: > > > > > >>explain analyze select * from p_areas where > deactive is null; > > > > > > The problem seems to be here: > >

Re: [PERFORM] Slow execution time when querying view with WHERE clause

2004-11-23 Thread Mike Mascari
Tom Lane wrote: Mike Mascari <[EMAIL PROTECTED]> writes: When I query the view with a simple filter, I get: explain analyze select * from p_areas where deactive is null; The problem seems to be here: -> Seq Scan on _areas a (cost=0.00..2.48 rows=1 width=163) (actual time=0.037..0.804 rows=

Re: [PERFORM] Slow execution time when querying view with WHERE clause

2004-11-23 Thread Tom Lane
Mike Mascari <[EMAIL PROTECTED]> writes: > When I query the view with a simple filter, I get: > explain analyze select * from p_areas where deactive is null; The problem seems to be here: > -> Seq Scan on _areas a (cost=0.00..2.48 rows=1 width=163) (actual > time=0.037..0.804 rows=48 loop

Re: [PERFORM] Slow execution time when querying view with WHERE clause

2004-11-22 Thread Mike Mascari
Mike Mascari wrote: I have the following view: create or replace view market.p_areas as select a.* from _areas a where a.area in ( select b.area from _bins b, _inventories i, _offers o, _pricemembers p where b.bin = i.bin and i.inventory = o.inventory and o.pricegroup = p.pricegroup and p.buy

[PERFORM] Slow execution time when querying view with WHERE clause

2004-11-22 Thread Mike Mascari
I have the following view: create or replace view market.p_areas as select a.* from _areas a where a.area in ( select b.area from _bins b, _inventories i, _offers o, _pricemembers p where b.bin = i.bin and i.inventory = o.inventory and o.pricegroup = p.pricegroup and p.buyer in ( select s.s