Re: [SQL] Different Choices For Index/Sequential Scan With And Without A Join In 7.2

2001-08-26 Thread markir
> Mark kirkwood <[EMAIL PROTECTED]> writes: > > Note that 'f1' = '2000-01-26' corrosponds to 'd0key' = 270 in the table > > 'dim0'; > > What do you mean by "corresponds to"? Is there a one-to-one mapping > between distinct values of fact0.d0key and distinct values of dim0.f1? > Or do you jus

Re: [SQL] "AND", "OR" and Materialize :((((

2001-08-26 Thread Meszaros Attila
Hi, > > WHY SHALL IT MATERIALIZE A CONSTANT RESULT IN A LOOP OF 12 TIMES ?? > > [it would be enough to materialize only once, > > Which in fact is exactly what the materialize node is for. The reported > costs are pretty bogus, but AFAICT the plan is the right thing. Thanx for the

Re: [SQL] "AND", "OR" and Materialize :((((

2001-08-26 Thread Tom Lane
Meszaros Attila <[EMAIL PROTECTED]> writes: > WHY SHALL IT MATERIALIZE A CONSTANT RESULT IN A LOOP OF 12 TIMES ?? > [it would be enough to materialize only once, Which in fact is exactly what the materialize node is for. The reported costs are pretty bogus, but AFAICT the plan is the right t

Re: [SQL] Different Choices For Index/Sequential Scan With And Without A Join In 7.2

2001-08-26 Thread Tom Lane
Mark kirkwood <[EMAIL PROTECTED]> writes: > Note that 'f1' = '2000-01-26' corrosponds to 'd0key' = 270 in the table > 'dim0'; What do you mean by "corresponds to"? Is there a one-to-one mapping between distinct values of fact0.d0key and distinct values of dim0.f1? Or do you just mean that the

Re: [SQL] undocumented setval()

2001-08-26 Thread Tom Lane
Cedar Cox <[EMAIL PROTECTED]> writes: > When looking through a dump file, I noticed a setval(text, int, > bool). What is this? It doesn't appear to be documented. The bool parameter sets the is_called state bit of the sequence. Without this you can't restore a sequence to a virgin "never nextva

[SQL] "AND", "OR" and Materialize :((((

2001-08-26 Thread Meszaros Attila
Hi all, We've got the following 3 tables and 2 simple queries. The only difference lies in the join condition: the first uses OR, the second uses AND. I expected some difference in the performace according to the difference in the evaluation of the logical form, but not 3 magnitudes !!! So the

[SQL] undocumented setval()

2001-08-26 Thread Cedar Cox
When looking through a dump file, I noticed a setval(text, int, bool). What is this? It doesn't appear to be documented. -Cedar ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] Different Choices For Index/Sequential Scan With And Without A Join In 7.2

2001-08-26 Thread Mark kirkwood
Dear List, I have been doing a little investigation on when the optimizer chooses a sequential scan over an index access. I have come accross what interesting behaviour in the current 7.2 sources ( 2001-08-17): The consider two types of query on my "usual" tables : SELECT f.d0key,