in reply to Perl DBI (sybase) rapidly delete large number of records

I tried doing the delete in perl (prepare the delete query then itterate round the list executing with each value) and the performance is terrible.

In the end I wrote the values to a file, used the sybase bulk copy tool to throw them into a temporary table and did a "delete from table where id in (select id form temp table)"

You will never be as fast as a bulk copy tool from Perl, regardless of the DB. There's just too much unavoidable overhead. That said, if the bcp approach is 4 seconds, 8-10 seconds in Perl sounds like a reasonable target to achieve.

I can't help wondering if you have automatic commits occurring, as that is the default behaviour. You must explicitly say AutoCommit => 0 to disable it.

That would neatly explain the 2 orders of magnitude slowdown that you see occurring, especially if the table in question has a number of indexes.

• another intruder with the mooring in the heart of the Perl

  • Comment on Re: Perl DBI (sybase) rapidly delete large number of records