All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

SQLite Query Optimization: Using Uncorrelated Subqueries to Skip Correlated Subqueries for Performance Gains

By

emschwartz

5mo ago· 8 min readen

Summary

The article describes a SQLite query optimization technique where an uncorrelated scalar subquery is used to skip expensive correlated subqueries, improving query performance by approximately 17%. The author shares this optimization discovered while working on domain exclusion lists and paywalled content filtering for their content aggregation tool called Scour, which processes 1-3 million pieces of content. The post explains technical SQL concepts and provides practical implementation details for database performance optimization.

Key quotes

· 5 pulled
using an uncorrelated scalar subquery to skip a correlated subquery
Skipping expensive per-row subqueries to speed up my average query ~17%
Scour searches noisy sources for content related to users' interests
I recently added domain exclusion lists and paywalled content filtering to Scour
This blog post describes a small but useful SQL(ite) query optimization
Snippet from the RSS feed
Skipping expensive per-row subqueries to speed up my average query ~17%.

You might also wanna read