我创建了一个 android 应用程序,并且有一个功能会定期删除旧记录
delete from tablea where col1 = 'value1' and col2 = 'value2' and postdate < '2010-06-14'
当 tablea 中的总行数超过 50,000 时,它会出现性能问题。删除 500 条记录大约需要 45 秒。
我已经有这个 where 子句的索引:
CREATE INDEX indexa on tablea (col1, col2, postdate)
添加 PRAGMA synchronous=OFF 和 PRAGMA count_changes=OFF 没有帮助。
请指教