Re: pg_stats and range statistics
Tomas Vondra <tomas.vondra@enterprisedb.com>
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Egor Rogov <e.rogov@postgrespro.ru>,
Soumyadeep Chakraborty <soumyadeep2007@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-01-20T21:50:56Z
Lists: pgsql-hackers
Attachments
- 0001-Display-length-and-bounds-histograms-in-pg_-20230120.patch (text/x-patch) patch 0001
- 0002-add-functions-to-extract-lower-upper-ramge--20230120.patch (text/x-patch) patch 0002
- 0003-rename-empty_range_frac-20230120.patch (text/x-patch) patch 0003
Hi Egor, While reviewing a patch improving join estimates for ranges [1] I realized we don't show stats for ranges in pg_stats, and I recalled we had this patch. I rebased the v2, and I decided to took a stab at showing separate histograms for lower/upper histogram bounds. I believe it makes it way more readable, which is what pg_stats is about IMHO. This simply adds two functions, accepting/producing anyarray - one for lower bounds, one for upper bounds. I don't think it can be done with a plain subquery (or at least I don't know how). Finally, it renames the empty_range_frac to start with range_, per the earlier discussion. I wonder if the new column names for lower/upper bounds (range_lower_bounds_histograms/range_upper_bounds_histograms) are too long ... regards [1] https://commitfest.postgresql.org/41/3821/ -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Collect and use histograms of lower and upper bounds for range types.
- 918eee0c497c 9.3.0 cited