5 ms·
Definitely measure the performance with sqlite though. I recently found one of my recursive queries had really bad performance compared with using a temporary
by Izkata 7y ago
Definitely measure the performance with sqlite though. I recently found one of my recursive queries had really bad performance compared with using a temporary table, because the CTE didn't create an automatic covering index. Had to separate it out into two queries (which changed it from something like .3s to .009s + .001s).
- SQLite 7y agoIf you will kindly send your problem query to the SQLite developers, we will do what we can to improve the query planner to make it run faster.
- Izkata 7y agoPosted (and reran the numbers with some unnecessary transformations removed): https://sqlite.org/forum/forumpost/e4091b433a https://sqlite.org/forum/forumpost/e4091b433a I may have misremembered since I did go a bit wild on this query (done while learning about recursive queries), but pulling the subquery into a CTE doesn't affect the query plan.