Most affordable · Databases
- 01Turso · DeveloperTurso$4.99 USD / month
- 02PlanetScale · Postgres PS-5PlanetScale$5.00 USD / month
- 03Cloudflare D1 · Workers PaidCloudflare$5.00 USD / month
Find the slow query with EXPLAIN and fix it with the right index
When an application gets slow, the database is usually the culprit, and the most frequent cause is a query reading far more rows than needed. Before upgrading a plan or changing engines, measure: EXPLAIN ANALYZE shows how PostgreSQL runs the query, how many rows it expected and how many it actually read.
The right index often turns seconds into milliseconds, but it has a cost too: it takes space and slows writes. That is why you should create the ones your real workload needs, not one per column. If after optimizing you still need more capacity, the database catalog lets you compare price, limits and billing model.
Turn on slow-query logging or the engine's statistics, sort by total time and start with the ones that accumulate the most. A 50 ms query run a million times weighs more than a 5 s query run once.
Look for sequential scans on large tables, row estimates far from the real counts and sorts spilling to disk. Codifly's index guide shows before-and-after examples with the exact changes.
When you have already optimized and the limit is capacity, connections or cost, not before. Compare each provider's billing model and limits in the catalog against your load, and remember that migrating has its own cost.
Tell us your volume and the options you are weighing. We reply in writing with the numbers of your real usage; no commitment.
No provider pays for its position. Indexes come from LLM Stats; prices from each provider's standard API. How we measure
Analysis, guides and new technology comparisons.