Skip to content

Improvement: Extend gstat statistics by indexes (null values) #8404

@sim1984

Description

@sim1984

Currently, gstat outputs the following statistics for the index:

    Index HORSE_IDX_BIRTHDAY (0) 
	Root page: 150238, depth: 2, leaf buckets: 167, nodes: 545113 
	Average node length: 4.94, total dup: 520604, max dup: 27865 
	Average key length: 2.00, compression ratio: 1.90 
	Average prefix length: 3.75, average data length: 0.05 
	Clustering factor: 436641, ratio: 0.80 
	Fill distribution: 
	     0 - 19% = 0 
	    20 - 39% = 1 
	    40 - 59% = 0 
	    60 - 79% = 0 
	    80 - 99% = 166 

It is proposed to expand this statistics with the number of null values ​​in the keys. This value is quite important if the index can contain null values, since the real selectivity for operations that do not take null into account will be different (primarily equality). It is clear that the share of null values ​​should be in the stored statistics, as is selectivity now. However, the number of null values ​​in the gstat output will also be useful for assessing the real selectivity.

    Index HORSE_IDX_BIRTHDAY (0) 
	Root page: 150238, depth: 2, leaf buckets: 167, nodes: 545113 
	Average node length: 4.94, total dup: 520604, max dup: 27865 
        Segments: 1, Nulls: 27866
	Average key length: 2.00, compression ratio: 1.90 
	Average prefix length: 3.75, average data length: 0.05 
	Clustering factor: 436641, ratio: 0.80 
	Fill distribution: 
	     0 - 19% = 0 
	    20 - 39% = 1 
	    40 - 59% = 0 
	    60 - 79% = 0 
	    80 - 99% = 166 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions