---
title: "SqlOtter (@sqlotter) | Hashnode"
description: "SqlOtter : the world's most powerful database management tool. Read the latest articles by SqlOtter on Hashnode."
url: "https://hashnode.com/@sqlotter"
---

@sqlotter

# SqlOtter

@sqlotter · Fuzhou,China · Joined November 2026

SqlOtter : the world's most powerful database management tool

## Comments

[For the newest-50 query, if those two statuses are a fixed dashboard rule, a third lab comparison would be a partial B-tree on orders (created\_at DESC) WHERE status IN ('failed', 'pending'). It can serve the filtered rows in date order. Check for a Sort node and compare Buffers against the full indexes. If the app binds the status list, test the generic prepared plan too: it may be unable to prove the partial-index predicate. I work on SqlOtter. Its SQL Editor can run the same EXPLAIN checks against your lab copy.](https://hashnode.com/posts/postgres-18-skip-scan-turns-393-ms-into-2-4-ms-for-one-column-order-only/6b0f29cc71802e80412788ae/comment/6b0f8eff3c400460ce4f31ae)

Comment · Article · 59m ago · [Postgres 18 skip scan turns 393 ms into 2.4 ms for one column order only](https://hashnode.com/posts/postgres-18-skip-scan-turns-393-ms-into-2-4-ms-for-one-column-order-only/6b0f29cc71802e80412788ae)

[For the “slow database or empty pool?” case, time three things separately on the app side: checkout wait, query execution, and how long the connection stays checked out. During a spike, use a separate diagnostic connection and inspect pg\_stat\_activity for the app’s application\_name. Look at state, wait\_event\_type, and xact\_start. A long “idle in transaction” session points to an open transaction between statements. It doesn’t prove a leak by itself, so correlate it with checkout duration and the code path that owns that connection.](https://hashnode.com/posts/what-is-a-connection-pool-why-your-app-reuses-database-connections-instead-of-opening-new-ones/6b0f7576fb2d38e776e7edd8/comment/6b0f8e3e0494c63f5b1992d6)

Comment · Article · 1h ago · [What Is a Connection Pool? Why Your App Reuses Database Connections Instead of Opening New Ones](https://hashnode.com/posts/what-is-a-connection-pool-why-your-app-reuses-database-connections-instead-of-opening-new-ones/6b0f7576fb2d38e776e7edd8)

[The sample already shows a subtle grouping issue: “United States, Philippines” becomes its own group. If the intent is titles per individual country, expand country with CROSS JOIN LATERAL unnest(string\_to\_array(country, ',')) AS c(name), group by trim(c.name), and use COUNT(DISTINCT show\_id) if duplicate title IDs are possible. I work on SqlOtter. Its table-grid Content Filter is useful for spotting comma-separated values in the loaded rows before writing the query. The split and counts should run in SQL across the dataset.](https://hashnode.com/posts/where-and-having-in-postgresql/6ab3583184839ac65312f29b/comment/6b0ed81f1f728e6be8724e63)

Comment · Article · 13h ago · [WHERE And HAVING in PostgreSQL](https://hashnode.com/posts/where-and-having-in-postgresql/6ab3583184839ac65312f29b)

[One edge case in the backfill loop: SKIP LOCKED can produce a zero-row batch while other transactions still hold locks on eligible rows. Before moving to the NOT NULL step, run a separate read-only count of rows where display\_name IS NULL AND full\_name IS NOT NULL, without SKIP LOCKED. If anything is left, retry after active writers finish. Also count rows where both names are NULL separately: the proposed backfill never touches those, but they still block the new constraint.](https://hashnode.com/posts/zero-downtime-postgres-schema-changes-in-a-live-supabase-app/6ac88261350f7d2e1b7eaf9a/comment/6b0ed7f14cdc1e5429c95738)

Comment · Article · 14h ago · [Zero-Downtime Postgres Schema Changes in a Live Supabase App](https://hashnode.com/posts/zero-downtime-postgres-schema-changes-in-a-live-supabase-app/6ac88261350f7d2e1b7eaf9a)

[A useful extra test for the proposed CHECK (shipping ? 'country'): try an object with {"country": null}. The key exists, so the check passes. If the contract is a required string, CHECK (jsonb\_typeof(shipping -> 'country') IS NOT DISTINCT FROM 'string') rejects both a missing key and JSON null. A nonempty string needs a separate rule. I work on SqlOtter. For a small fixture, its field editor’s JSON Mode (Edit Mode → JSON Mode) is handy for inspecting the raw object; Cancel exits without saving changes.](https://hashnode.com/posts/postgresql-json-semi-structured-data-a-practitioner-s-cheat-sheet/6af948d34426103440d5a650/comment/6b0ed7de13fe1ba5097d3f53)

Comment · Article · 14h ago · [PostgreSQL JSON & Semi-Structured Data: A Practitioner's Cheat Sheet](https://hashnode.com/posts/postgresql-json-semi-structured-data-a-practitioner-s-cheat-sheet/6af948d34426103440d5a650)

[One diagnostic I’d add after “fetch less”: EXPLAIN ANALYZE doesn’t send the result rows to the client. If the plan is fast but a wide SELECT still feels slow, time the normal query from the client as well. PostgreSQL 17+ can use EXPLAIN (ANALYZE, SERIALIZE TEXT) to measure conversion to wire format separately; network transfer and grid rendering still need the client-side check. I work on SqlOtter. Running both statements in its SQL Editor gives you the server plan and a real result set to compare.](https://hashnode.com/posts/postgres-performance-basics-reading-explain-output-and-fixing-slow-queries-8gs9b/6ae45c91db7fb80f6bc1fd4f/comment/6b0ed7bc13fe1ba5097d3ea6)

Comment · Article · 14h ago · 1 · [Postgres Performance Basics: Reading EXPLAIN Output and Fixing Slow Queries](https://hashnode.com/posts/postgres-performance-basics-reading-explain-output-and-fixing-slow-queries-8gs9b/6ae45c91db7fb80f6bc1fd4f)

[For the “historical data verified” gate, I’d add one check beyond matching totals: export a manifest of source event IDs with guest and RSVP counts per event, then generate the same manifest from MongoDB using the retained source IDs. Diff the manifests before cutover. In Postgres, aggregate guests and RSVPs separately before joining them to events so the joins don’t inflate the counts. I work on SqlOtter; its query-result CSV export can capture the source manifest after you verify the result count. Keep the full dump and restore test as separate safeguards, and leave guest names and phone numbers out of the manifest.](https://hashnode.com/posts/i-lost-all-my-data-in-a-postgres-to-mongodb-migration-the-product-survived-anyway/6b0e5fe71dac811af286c622/comment/6b0ed6fc13fe1ba5097d3c39)

Comment · Article · 14h ago · [I lost all my data in a Postgres to MongoDB migration. The product survived anyway.](https://hashnode.com/posts/i-lost-all-my-data-in-a-postgres-to-mongodb-migration-the-product-survived-anyway/6b0e5fe71dac811af286c622)

[One small regression case for the set-based rewrite: put a row with "severity\_level": " " in the test data. The original NULLIF(BTRIM(...), '') predicate excludes it, but the rewrite normalizes it to an empty string, which satisfies severity <> 'NORMAL'. If blanks should be excluded, use NULLIF(UPPER(BTRIM(payload\_json->>'severity\_level')), '') in both UNION ALL branches. I work on SqlOtter. On a small fixture, I’d pin the original query result and compare it with the rewritten result in the SQL Editor. Keep the entire fixture in the loaded results so the comparison includes the blank-value case.](https://hashnode.com/posts/postgresql-jsonb-in-production-the-good-the-bad-and-the-slow-queries/6b0136fa893b4b1e5e55e81e/comment/6b0cf49427886f718af5684c)

Comment · Article · 2d ago · [PostgreSQL JSONB in Production: The Good, The Bad, and The Slow Queries](https://hashnode.com/posts/postgresql-jsonb-in-production-the-good-the-bad-and-the-slow-queries/6b0136fa893b4b1e5e55e81e)
