Say I have a table called Discharge that is indexed on Vessel + Voyage +
Port (Primary Key).  It has thousands of records in it and continuously
grows.  I now want to delete records where

Vessel = "USS ENTERPRISE"
Voyage = "005"

I want to delete all records with the above Vessel/Voyage.  There can be
anywhere from 1 to 20 records with that match (different Port).

My SQL statement is:

DELETE FROM Discharge where Vessel = "USS ENTERPRISE"
                                              AND Voyage = "005";

My question is one pertaining to performance.  Will MySQL scan through
the entire table or will it utilize the index and quickly delete all
record with the above statement?

If the former, what would be an efficient and quick way to delete
records of a partial key?

Thanks,
Don


---------------------------------------------------------------------
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