Message -
From: "John Almberg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 23, 2003 12:37 PM
Subject: speeding up a search
> I am trying to find records (from the 'stamps' table) that are NOT
> related to records in the '
Make sure stamps.item_id and links.item_id are indexed, I had a similar
problem, and when I indexed the columns, it went down to less than a half
second.
KL
John Almberg wrote:
> I am trying to find records (from the 'stamps' table) that are NOT
> related to records in the 'links' table. To do
Run explain on the query and see if indexes are being used.
John Almberg wrote:
I am trying to find records (from the 'stamps' table) that are NOT
related to records in the 'links' table. To do this, I'm using a left
join. For example:
select s.*, l.item_id as lid from stamps as s left join li
Wow! One of the fields was a primary key, but the other wasn't. When I
indexed the second field the performance went up from 2 minutes to about
2 seconds. Thanks a bunch.
-- John
Kelley Lingerfelt wrote:
Make sure stamps.item_id and links.item_id are indexed, I had a similar
problem, and when
I am trying to find records (from the 'stamps' table) that are NOT
related to records in the 'links' table. To do this, I'm using a left
join. For example:
select s.*, l.item_id as lid from stamps as s left join links as l on ((
s.item_id=l.item_id)) WHERE (s.sold is null);
This worked great w