Re: [SQL] Using bitmap index scans-more efficient

2006-08-16 Thread Tom Lane
Kyle Bateman <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Before 8.2 the optimizer has no ability to rearrange the order of outer >> joins. Do you have time to try your test case against CVS HEAD? > OK, I figured it out--grabbed the latest snapshot (hope that is what you > need). > My result

Re: [SQL] Using bitmap index scans-more efficient

2006-08-16 Thread Kyle Bateman
Tom Lane wrote: Kyle Bateman <[EMAIL PROTECTED]> writes: I'm wondering if this might expose a weakness in the optimizer having to do with left joins. Before 8.2 the optimizer has no ability to rearrange the order of outer joins. Do you have time to try your test case against CVS HEAD

Re: [SQL] Using bitmap index scans-more efficient

2006-08-16 Thread Tom Lane
Kyle Bateman <[EMAIL PROTECTED]> writes: > I'm wondering if this might expose a weakness in the optimizer having to > do with left joins. Before 8.2 the optimizer has no ability to rearrange the order of outer joins. Do you have time to try your test case against CVS HEAD?

Re: [SQL] Using bitmap index scans-more efficient

2006-08-15 Thread Kyle Bateman
Tom Lane wrote: Kyle Bateman <[EMAIL PROTECTED]> writes: But I'm assuming that using an interval-encoded project tree, I would have to do something like the following to get a progency group: select * from ledger l, proj p where p.proj_id = l.proj and p.left > 1234 and p.right < 2345;

Re: [SQL] Using bitmap index scans-more efficient

2006-08-15 Thread Kyle Bateman
Tom Lane wrote: Kyle Bateman <[EMAIL PROTECTED]> writes: But I'm assuming that using an interval-encoded project tree, I would have to do something like the following to get a progency group: select * from ledger l, proj p where p.proj_id = l.proj and p.left > 1234 and p.right < 2

Re: [SQL] Using bitmap index scans-more efficient

2006-08-14 Thread Tom Lane
Kyle Bateman <[EMAIL PROTECTED]> writes: > But I'm assuming that using an interval-encoded project tree, I would > have to do something like the following to get a progency group: > select * from ledger l, proj p where p.proj_id = l.proj and p.left > > 1234 and p.right < 2345; btree has no idea

Re: [SQL] Using bitmap index scans-more efficient

2006-08-14 Thread Kyle Bateman
Florian Weimer wrote: * Kyle Bateman: Any ideas about whether/how this can be done? If the project tree is fairly consistent, it's convenient to encode it using intervals instead of parent/child intervals. IIRC, Celko's "SQL for smarties" explains how to do this, and Kristian Koehnt

Re: [SQL] Using bitmap index scans-more efficient

2006-08-13 Thread Florian Weimer
* Kyle Bateman: > Any ideas about whether/how this can be done? If the project tree is fairly consistent, it's convenient to encode it using intervals instead of parent/child intervals. IIRC, Celko's "SQL for smarties" explains how to do this, and Kristian Koehntopp has written some PHP code to

[SQL] Using bitmap index scans-more efficient

2006-08-13 Thread Kyle Bateman
How can I use bitmap index scans more effectively? (version 8.1.0) I have a financial ledger (actually a view, grouping several other tables) containing about a million records. Each record contains an account code and a project code. I can query for all the transactions belonging to any sing