From 93bbeec6a21b76612d77176a8054b41277135684 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 2 May 2017 18:49:32 -0300 Subject: extstats: change output functions to emit valid JSON Manipulating extended statistics is more convenient as JSON than the current ad-hoc format, so let's change before it's too late. Discussion: https://postgr.es/m/20170420193828.k3fliiock5hdnehn@alvherre.pgsql --- doc/src/sgml/perform.sgml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml index a8bebb14363..b10b734b901 100644 --- a/doc/src/sgml/perform.sgml +++ b/doc/src/sgml/perform.sgml @@ -1138,9 +1138,9 @@ ANALYZE zipcodes; SELECT stxname, stxkeys, stxdependencies FROM pg_statistic_ext WHERE stxname = 'stts'; - stxname | stxkeys | stxdependencies ----------+---------+-------------------------------------------- - stts | 1 5 | [{1 => 5 : 1.000000}, {5 => 1 : 0.423130}] + stxname | stxkeys | stxdependencies +---------+---------+------------------------------------------ + stts | 1 5 | {"1 => 5": 1.000000, "5 => 1": 0.423130} (1 row) where it can be seen that column 1 (a zip code) fully determines column @@ -1225,10 +1225,9 @@ ANALYZE zipcodes; SELECT stxkeys AS k, stxndistinct AS nd FROM pg_statistic_ext WHERE stxname = 'stts2'; --[ RECORD 1 ]--------------------------------------------- +-[ RECORD 1 ]-------------------------------------------------------- k | 1 2 5 -nd | [{(b 1 2), 33178.000000}, {(b 1 5), 33178.000000}, - {(b 2 5), 27435.000000}, {(b 1 2 5), 33178.000000}] +nd | {"1, 2": 33178, "1, 5": 33178, "2, 5": 27435, "1, 2, 5": 33178} (1 row) which indicates that there are three combinations of columns that -- cgit v1.2.3