Hi folks,

I have a problem that normally I'd want to use subselects on.  Here
it goes:

Table t1 has a column data_id.  Table t2 has a column data_id.  Both
are foreign keys for the autoincrement primary column "id" of the
table called "data".

I wish to delete every row from data which is NOT referenced in
tables t1 and t2.  The manual seems to suggest doing a three table
left join and matching on both t1.data_id and t2.data_id being NULL.
I am concerned this would take way too long, though I can get away
with only doing this query say once a week.  t1 currently has
221,422 rows, t2 has 18,726 rows, and data currently has 157,791
rows.  Is this really the best way?

I'm stuck with MyISAM table type and the hardware I'm doing this on
is decidedly budget.

Anyone got any recommendations?

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to