Re: [SQL] Breaking up a query

2006-08-13 Thread Andrew Sullivan
On Thu, Aug 10, 2006 at 06:53:33PM -0400, Saad Anis wrote: > Hi Guys, > > A fellow at work has written the SQL below to retrieve some data from > multiple tables. Obviously it is inefficient and unnecessarily complex, and Why is that obvious? Why do you think that joining in your application is

[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

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