db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendle...@amberpoint.com>
Subject Re: Performance deleting lots of rows from a table
Date Wed, 14 Jan 2009 15:19:14 GMT
> I need to delete a considerable number of rows from a table, and it is 
> taking too long.  The operation takes equally long from ij, so I think 
> it is independent of my application code.

As an alternate technique, you could try instead copying the rows that
you want to keep to a new table, then dropping the old table and switching
to the new table:

  - create new table with different table name, but same column definitions
  - insert into new table select rows-to-keep from current table
  - drop current table
  - rename new table to have same name as current table

You might benchmark this technique, to see if it is any faster.

bryan



Mime
View raw message