RE: Opimizing SQL query

"Tim Lucia" <[email protected]>
Newsgroups gmane.comp.db.mysql.java
Message-ID <000c01c6907b$fffbd870$3c0119ac@timlap>
You should ask this on the users list, not the java list
([email protected]).  When you do, please include the output of EXPLAIN,
if that doesn't already answer your question for you.

Tim

-----Original Message-----
From: [email protected] [mailto:[email protected]] 
Sent: Thursday, June 15, 2006 7:35 AM
To: [email protected]
Subject: Opimizing SQL query


Hi,



I have a table with 1,00,000 records. I have to delete 10,000 records
and the query framed is something like this :
delete from naptrrecord where id in (1,2,3,4....,10000) and id not
in(111,222.....);


The records that we are trying to delete are not sequential so we are
sending all the IDs. This query is ver slow. Can you please give me some
ideas to optimize it.


Thanks
Prasad



The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain proprietary, confidential or privileged information. If you are not
the intended recipient, you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately and destroy all copies of this
message and any attachments.


WARNING: Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.


www.wipro.com


-- 
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.