Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 4 min read How-to mediumAdept

Easier Postgres fine-tuning with online_advisor

online_advisor is a Postgres extension that hooks into the executor (like auto_explain) to watch the live workload and recommend indexes, extended statistics, or prepared statements without applying anything automatically. It suggests indexes when a predicate filters more than 1,000 rows (filtered_threshold), multivariate statistics when actual rows exceed estimates by 10x (misestimation_threshold), and prepared statements when planning time exceeds execution time (prepare_threshold 1.0). Recommendations are queried from proposed_indexes and proposed_statistics views with call counts and elapsed time, and the reader then creates the object and runs VACUUM ANALYZE. It supports Postgres 14–17, though Neon offers it only on 17.

Related posts

  • Performance tips for Neon Postgres

    Neon mediumAdept

    Neon's serverless Postgres follows mostly standard Postgres tuning, plus a few Neon-specific checks. Size compute at roughly 100 connections per GB of RAM, use pooling and autoscaling, then find slow queries with pg_stat_statements and EXPLAIN (ANALYZE, BUFFERS). Fix them with indexes, REINDEX and autovacuum tuning against bloat, and by keeping the local file cache hit ratio (shown in neon_stat_file_cache) above 99%. For faster ingests, batch inserts, drop unused indexes, offload reads to ephemeral read replicas, and test changes safely on a database branch.

  • Postgres Support Recap: Investigating Postgres Query Performance

    Neon mediumAdept

    Three starting points for diagnosing slow Postgres queries: use pg_stat_statements to find long-running queries by mean execution time and then EXPLAIN ANALYZE them, check the cache hit ratio (in Neon via the neon_stat_file_cache view, since Neon extends shared buffers with a local file cache), and look for table and index bloat caused by MVCC dead tuples. A hit ratio below 99% suggests the working set doesn't fit in memory, which calls for more shared_buffers or a larger Neon compute. Bloat is reduced with VACUUM, VACUUM FULL or REINDEX, all of which take locks. PgHero, run via Docker, gives a free dashboard alternative.

  • The 10 Most Popular Postgres Extensions on Neon

    Neon easyNovice

    The ten most installed Postgres extensions across Neon's platform are plpgsql and pg_stat_statements (each in 1M+ databases), followed by uuid-ossp, pgvector, pgcrypto, pg_trgm, PostGIS, citext, unaccent and hstore. Each gets a short explanation of its use cases, such as query performance monitoring, UUID generation, vector similarity search, password hashing, fuzzy matching, spatial queries and case- or accent-insensitive text, along with a one-line SQL example. Neon also published a live dashboard, built with v0, that ranks extensions by install count and trending usage, and notes growing adoption of pg_search and mooncake.

  • Debug your Postgres from the terminal: a tour of `neon inspect db`

    Neon mediumAdept

    `neon inspect db` adds fourteen read-only Postgres diagnostic subcommands to the Neon CLI, each running one curated query against Postgres statistics and catalog views (table/index sizes, bloat, unused indexes, seq scans, long-running queries, locks, pg_stat_statements outliers and calls, vacuum stats, replication slots, subscriptions). Connections resolve automatically for linked Neon projects, and most commands also work on any Postgres via `--db-url`. Output is bounded and available as JSON or YAML, which makes it safer for agents than raw SQL access. Neon-specific commands report Local File Cache hit rate (aim for 0.99+) and working set versus LFC size to signal when to scale compute, since Neon pins shared_buffers at 128 MB.

  • 6 tips to optimize storage costs for your Postgres databases

    Neon mediumAdept

    Six ways to shrink Postgres storage spend: drop unused indexes (found via pg_stat_user_indexes and pg_index), avoid full database copies for dev and staging by using Neon's copy-on-write branching, choose smaller data types like SMALLINT, order columns largest to smallest to cut alignment padding, shorten Neon's history retention window, and tune autovacuum to limit bloat. Shorter retention saves storage but narrows the point-in-time recovery window. For bloat, look in pg_stat_activity for long-running transactions that block autovacuum.

The quest for software engineering knowledge.

Look:
Layout: