To using the sql temp table solve this problem, when mulit-threads from different JVM do the same operation, they should use different temp table names to avoid thread conflicts.
But when you do this, the query speed become slower than expected, is there some methods to help speed up this multi-table-select-delete operation? Thanks a lot! Shang Kun On May 12, 3:35 am, Thomas Mueller <[email protected]> wrote: > Hi, > > What about moving the rows into an intermediate table first? > > create temp table temp as > SELECT A.id,B.id,C.id FROM A,B,C WHERE <conditions> LIMIT 0,1 > DELETE FROM A WHERE id IN (SELECT A.id FROM temp); > DELETE FROM B WHERE id IN (SELECT B.id FROM temp); > DELETE FROM C WHERE id IN (SELECT C.id FROM temp); > drop table temp; > > Regards, > Thomas > > -- > You received this message because you are subscribed to the Google Groups "H2 > Database" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group > athttp://groups.google.com/group/h2-database?hl=en. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
