D
David Kaye
Okay, I need to find data that is in one table but not the other. One
method would be:
SELECT artist,title FROM table1 WHERE artist&title NOT IN (SELECT
artist&title FROM table2)
I'm sure this query would work if only it would finish! The problem is that
table1 has 40,000 records and table2 has 37,000 records. Both tables have
indices on artist and title, and I also added an index on artist&title on
each table. But it STILL takes forever to run. After half an hour I gave
up.
You may wonder why I combined artist and title in the query. It's because
the Jet(Access) engine tends to run faster when combining fields. I could
also run it with the fields separated, but it still takes forever and a day
to run.
I've also tried to JOIN the tables, and while it works very well with IN it
simply won't run in a decent amount of time when using NOT IN.
Does anybody have a query solution that will run fast or at least won't run
my CPU at 50% and never finish?
method would be:
SELECT artist,title FROM table1 WHERE artist&title NOT IN (SELECT
artist&title FROM table2)
I'm sure this query would work if only it would finish! The problem is that
table1 has 40,000 records and table2 has 37,000 records. Both tables have
indices on artist and title, and I also added an index on artist&title on
each table. But it STILL takes forever to run. After half an hour I gave
up.
You may wonder why I combined artist and title in the query. It's because
the Jet(Access) engine tends to run faster when combining fields. I could
also run it with the fields separated, but it still takes forever and a day
to run.
I've also tried to JOIN the tables, and while it works very well with IN it
simply won't run in a decent amount of time when using NOT IN.
Does anybody have a query solution that will run fast or at least won't run
my CPU at 50% and never finish?