This uses a brute force slowish approach by iterating over CSR id and then
dropping all but the last valid Certificate for each csr.
It can be more efficiently done inside the database, except that the memory
used might cause a slight headache on SQLite. Running the single query version
took several minutes on SQLite with 150k certificates give or take.
This uses a brute force slowish approach by iterating over CSR id and then dropping all but the last valid Certificate for each csr.
It can be more efficiently done inside the database, except that the memory used might cause a slight headache on SQLite. Running the single query version took several minutes on SQLite with 150k certificates give or take.