Subject Re: [firebird-support] Fast massive delete with complex criteria
Author Josef Kokeš
> I find myself in a situation where I need to delete large amount of data
> from a huge (comparably) table, with relatively complex criteria on what
> stays and what gets deleted:
>
> - The table in question has about 6 million rows.
> - The rows contain a mix of integer, timestamp and blob columns, with
> primary key A (integer) and secondary keys B (integer), C (integer) and
> D (timestamp).
> - I want to keep at least one record for every combination of B and C:
> a) the newest (HAVING D = MAX(D))
> b) within the last 30 days ((D+30)> 'now')

Forgot to mention: the table and its indexes amount to some 10 GB or so.

Pepak