{"schema": "pgtrue.report/1", "url": "https://pgtrue.postgres.ai/shared/brief/ebdff22c-3e4b-4883-80be-af4b0d91ace6", "published": "2026-10-19T08:06:21Z", "publisher": "PostgresAI", "article": {"title": "Why is my Whale Query 1000x Slower in Prod? \u2014 Databases hate skew, each hates it differently - Blog", "url": "https://exobench.ai/blog/why-is-my-whale-query-1000x-slower-in-prod", "date_published": "2026-05-26T00:00:00Z", "author": "Alexander Ioffe", "publisher": "ExoBench"}, "grade": "B", "axes": [{"axis": "Factual", "summary": "A \u00b7 0 wrong of 11 checked \u00b7 0 caveats"}, {"axis": "Applicable", "summary": "A \u00b7 0 wrong of 4 checked \u00b7 0 caveats"}, {"axis": "Consistent", "summary": "A \u00b7 0 wrong of 11 checked \u00b7 0 caveats"}, {"axis": "Transparent", "summary": "C \u00b7 0 wrong of 7 checked \u00b7 0 caveats \u00b7 reproducibility: C (no hardware)"}, {"axis": "Safe", "summary": "B+ \u00b7 0 wrong of 5 checked \u00b7 0 caveats \u00b7 1 unwarned risk"}], "findings": [{"anchor": "F2", "url": "https://pgtrue.postgres.ai/shared/brief/ebdff22c-3e4b-4883-80be-af4b0d91ace6#F2", "claim": "\u2026One session-level setting.", "title": "enable_nestloop is a user-settable planner option", "explanation": "src/backend/utils/misc/guc_tables.c:903-909 defines enable_nestloop as USERSET, default on. src/backend/optimizer/path/costsize.c:3281-3285 counts nested loops as disabled when it is off. doc/src/sgml/config.sgml:5765-5769 says this discourages nested loops when alternatives exist. The session-setting description holds.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L5765-L5769", "label": "REL_18_6 \u00b7 doc/src/sgml/config.sgml:5765-5769"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/misc/guc_tables.c#L903-L909", "label": "REL_18_6 \u00b7 src/backend/utils/misc/guc_tables.c:903-909"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/optimizer/path/costsize.c#L3281-L3285", "label": "REL_18_6 \u00b7 src/backend/optimizer/path/costsize.c:3281-3285"}]}, {"anchor": "F3", "url": "https://pgtrue.postgres.ai/shared/brief/ebdff22c-3e4b-4883-80be-af4b0d91ace6#F3", "claim": "Postgres extended statistics ( CREATE STATISTICS ) won't save you\u2026", "title": "CREATE STATISTICS does not supply join selectivity estimates", "explanation": "doc/src/sgml/ref/create_statistics.sgml:176-178 states that extended statistics do not support table-join selectivity estimation. CREATE STATISTICS cannot directly encode the article's customer-tier-to-order-fan-out relationship across two tables.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/create_statistics.sgml#L176-L178", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/create_statistics.sgml:176-178"}]}, {"anchor": "F4", "url": "https://pgtrue.postgres.ai/shared/brief/ebdff22c-3e4b-4883-80be-af4b0d91ace6#F4", "claim": "The nested-loop plan's cost scales with the number of probes\u2026", "title": "Ordinary nested-loop cost includes repeated inner scans", "explanation": "src/backend/optimizer/path/costsize.c:3322-3328 adds inner_rescan_run_cost for each additional outer row. Underestimating outer rows can underprice repeated index probes. The article's basic nested-loop cost explanation holds.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/optimizer/path/costsize.c#L3322-L3328", "label": "REL_18_6 \u00b7 src/backend/optimizer/path/costsize.c:3322-3328"}]}, {"anchor": "F5", "url": "https://pgtrue.postgres.ai/shared/brief/ebdff22c-3e4b-4883-80be-af4b0d91ace6#F5", "claim": "\u2026SELECT query, calls, mean_exec_time FROM pg_stat_statements\u2026", "explanation": "REL_18_6 contrib/pg_stat_statements/pg_stat_statements--1.7--1.8.sql:15-34 defines function outputs query, calls, and mean_exec_time. doc/src/sgml/pgstatstatements.sgml:235-238 defines mean_exec_time in milliseconds. These citations support the selected output names and timing unit.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/pgstatstatements.sgml#L235-L238", "label": "REL_18_6 \u00b7 doc/src/sgml/pgstatstatements.sgml:235-238"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/pg_stat_statements/pg_stat_statements--1.7--1.8.sql#L15-L34", "label": "REL_18_6 \u00b7 contrib/pg_stat_statements/pg_stat_statements--1.7--1.8.sql:15-34"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/select.sgml#L36-L40", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/select.sgml:36-40"}]}, {"anchor": "F6", "url": "https://pgtrue.postgres.ai/shared/brief/ebdff22c-3e4b-4883-80be-af4b0d91ace6#F6", "claim": "\u2026the optimizer estimates each branch separately\u2026", "title": "PostgreSQL estimates append children separately", "explanation": "src/backend/optimizer/path/allpaths.c:1145-1151 computes each append child's size. Lines 1177-1181 add child row estimates to the parent estimate. Separate branch estimation holds. The claimed accuracy of this benchmark's UNION ALL plan remains unverified.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/optimizer/path/allpaths.c#L1145-L1151", "label": "REL_18_6 \u00b7 src/backend/optimizer/path/allpaths.c:1145-1151"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/optimizer/path/allpaths.c#L1177-L1181", "label": "REL_18_6 \u00b7 src/backend/optimizer/path/allpaths.c:1177-1181"}]}, {"anchor": "F7", "url": "https://pgtrue.postgres.ai/shared/brief/ebdff22c-3e4b-4883-80be-af4b0d91ace6#F7", "claim": "\u2026CREATE TABLE customers (id INT PRIMARY KEY , name TEXT , tier TEXT );\u2026", "explanation": "The customers declaration uses typed columns and a column primary key. REL_18_6 doc/src/sgml/ref/create_table.sgml:2035-2053 demonstrates that declaration structure. doc/src/sgml/ref/select.sgml:36-40 documents SELECT, FROM, WHERE, and GROUP BY. These excerpts support those structures, rather than validating the complete three-table aggregate.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/create_table.sgml#L2035-L2053", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/create_table.sgml:2035-2053"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/select.sgml#L36-L40", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/select.sgml:36-40"}]}, {"anchor": "F11", "url": "https://pgtrue.postgres.ai/shared/brief/ebdff22c-3e4b-4883-80be-af4b0d91ace6#F11", "claim": "\u2026Execution time 1,572 ms 309 ms\u2026", "title": "The displayed PostgreSQL timings support the 5.1\u00d7 speedup", "explanation": "The displayed timings imply a 5.09\u00d7 speedup (derived: 1,572 ms / 309 ms). Rounding to 5.1\u00d7 is correct.", "verdict": "Accurate", "sources": []}, {"anchor": "F12", "url": "https://pgtrue.postgres.ai/shared/brief/ebdff22c-3e4b-4883-80be-af4b0d91ace6#F12", "claim": "\u2026~1,945,000 ~8,500\u2026", "title": "The displayed buffer counts support the approximately 230\u00d7 reduction", "explanation": "The displayed buffer-hit counts imply a 229\u00d7 reduction (derived: 1,945,000 hits / 8,500 hits). Approximately 230\u00d7 is correct.", "verdict": "Accurate", "sources": []}, {"anchor": "F13", "url": "https://pgtrue.postgres.ai/shared/brief/ebdff22c-3e4b-4883-80be-af4b0d91ace6#F13", "claim": "\u2026391ms, which is 22% slower\u2026", "title": "The table-split comparison correctly calculates 70 ms and 22%", "explanation": "The split takes 70 ms longer (derived: 391 ms \u2212 321 ms). That increase is 21.8% of the setting's runtime (derived: 70 ms / 321 ms). The article correctly rounds this to 22%.", "verdict": "Accurate", "sources": []}, {"anchor": "F14", "url": "https://pgtrue.postgres.ai/shared/brief/ebdff22c-3e4b-4883-80be-af4b0d91ace6#F14", "claim": "\u2026234 \u2192 720,127 ( ~3,000x under ) 298 \u2192 719,417 ( ~2,400x under )\u2026", "title": "The displayed join counts support approximately 2,400\u00d7\u20133,000\u00d7 underestimates", "explanation": "PostgreSQL's factor is approximately 3,080\u00d7 (derived: 720,127 rows / 234 estimated rows). SQL Server's factor is approximately 2,410\u00d7 (derived: 719,417 rows / 298 estimated rows). The stated approximate factors match.", "verdict": "Accurate", "sources": []}, {"anchor": "F15", "url": "https://pgtrue.postgres.ai/shared/brief/ebdff22c-3e4b-4883-80be-af4b0d91ace6#F15", "claim": "\u2026~178 ~720,127 ~4,000x\u2026", "title": "The uniform-control appendix correctly rounds its PostgreSQL ratios", "explanation": "Joined rows increase approximately 4,050\u00d7 (derived: 720,127 rows / 178 rows). PostgreSQL runtime increases approximately 1,120\u00d7 (derived: 1,572 ms / 1.4 ms). The appendix's approximate ratios match these calculations.", "verdict": "Accurate", "sources": []}]}