Exists check takes forever in Django SQLite

This is normal, especially with a few million records on sqlite and I’m assuming without an index.

A missing word will always have to go through all records if there is no usable index. A word that is found, will terminate once found. There’s no noticable difference if the word you are looking for is the last word in table order.

And it’s actually because you’re using a slice, so the slice uses LIMIT and database can stop looking at first match.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top