bradical1379 — 2012-06-02T23:46:56-04:00 — #1
I have two tables with about 25k rows in each, and I am trying to find the differences between the two tables. The query is causing mysql to crash.
This is the query:
WHERE item NOT IN (
The item column is a varchar, but it contains a 13 digit number only. I am trying to find how many items from my inventory appear in one table over the over.
Oh, I am using MySQL client version: 5.1.49
r937 — 2012-06-03T02:32:58-04:00 — #2
ON data_backup.item = data.item
WHERE data_backup.item IS NULL
bradical1379 — 2012-06-03T19:14:26-04:00 — #3
Thanks for the help!
Unfortunately, the query is still crashing both ssh and phpmyadmin when I attempt to run it.
Any ideas on how I could better optimize it?
r937 — 2012-06-03T20:49:38-04:00 — #4
indexes on the join columns
could you please do a SHOW CREATE TABLE for both tables and i'll show you how
system — 2012-06-06T12:54:46-04:00 — #5
where "id" is the primary key column. If needed, you can retrieve the full rows after that, using the "id" results set.
Or some other relevant column(s). "SELECT *" is generally a bad idea.
mittineague — 2014-09-23T03:10:07-04:00 — #6
This topic is now archived. It is frozen and cannot be changed in any way.