Re: [SQL] JOIN not being calculated correctly

2004-11-20 Thread Tom Lane
"Scott Pederick" <[EMAIL PROTECTED]> writes: > Still can't fathom why it's not using an index scan on the jobs table.. Why exactly do you think that would make it faster? The query evidently requires visiting every single jobs row, so a seqscan seems appropriate to me; indeed I'd say the planner

Re: [SQL] JOIN not being calculated correctly

2004-11-20 Thread Scott Pederick
Hi Andrew, Thanks for your response - sorry it's taken so long to reply, I've been out of contact for a while. Still can't fathom why it's not using an index scan on the jobs table.. : Posting the EXPLAIN is a good, an EXPLAIN ANALYZE would be better : (assuming your dataset is small enough for

Re: [SQL] JOIN not being calculated correctly

2004-11-02 Thread Andrew Hammond
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Posting the EXPLAIN is a good, an EXPLAIN ANALYZE would be better (assuming your dataset is small enough for it to complete in this lifetime). You also need to include the following information: 1) The schema involved, including information about indexe

[SQL] JOIN not being calculated correctly

2004-10-30 Thread Scott Pederick
Hi all! I'm having a problem with Postgresql 8.0.0-beta4 on a Win2K machine and a particular join. I've got two tables - a list of customers and jobs they've had. A customer can have multiple jobs. The query always scans the entire jobs table for each customer - I need it the other way around so