Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit44eba8f

Browse files
committed
Add input function for data type pg_ndistinct
pg_ndistinct is used as data type for the contents of ndistinct extendedstatistics. This new input function consumes the format that has beenestablished by1f927cc for the output function of pg_ndistinct,enforcing some sanity checks for:- Checks for the input object, which should be a one-dimension arraywith correct attributes and values.- The key names: "attributes", "ndistinct". Both are required, otherkey names are blocked.- Value types for each key: "attributes" requires an array of integers,and "ndistinct" an integer.- List of attributes. Note that this enforces a check so as anattribute list has to be a subset of the longest attribute list found.This does not enforce that a full group of attribute sets exist, basedon how the groups are generated when the ndistinct objects aregenerated, making the list of ndistinct items a bit loose. Note a checkwould still be required at import to see if the attributes listed matchwith the attribute numbers set in the definition of a statistics object.- Based on the discussion, the checks on the values are loose, as thereis also an argument for potentially stats injection. The relation andattribute level stats follow the same line of argument for the values.This is required for a follow-up patch that aims to implement the importof extended statistics. Some tests are added to check the code paths ofthe JSON parser checking the shape of the pg_ndistinct inputs, with 90%of code coverage reached. The tests are located in their own new testfile, for clarity.Author: Corey Huinker <corey.huinker@gmail.com>Reviewed-by: Jian He <jian.universality@gmail.com>Reviewed-by: Chao Li <li.evan.chao@gmail.com>Reviewed-by: Michael Paquier <michael@paquier.xyz>Reviewed-by: Yuefei Shi <shiyuefei1004@gmail.com>Discussion:https://postgr.es/m/CADkLM=dpz3KFnqP-dgJ-zvRvtjsa8UZv8wDAQdqho=qN3kX0Zg@mail.gmail.com
1 parentcd38b7e commit44eba8f

File tree

5 files changed

+1316
-9
lines changed

5 files changed

+1316
-9
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp