Open simonw opened 4 years ago
Alternatively it could run as it does now but add a DELETE FROM index1.search_index WHERE key not in (select key from ...)
.
I'm not sure which would be more efficient.
I'm inclined to go with the first, simpler option. I have longer term plans for efficient incremental index updates based on clever trickery with triggers.
Here's why: https://github.com/dogsheep/dogsheep-beta/blob/24f7898d41a39218058f174c75ba62f7c0fcfff6/dogsheep_beta/utils.py#L44-L53
That should probably do
DELETE FROM index1.search_index WHERE [table] = ?
first.