Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSTAT reports wrong values for some index attributes after DML with long-key-indexed field fails with "Maximum index level reached" [CORE5005] #5293

Open
firebird-automations opened this issue Nov 10, 2015 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

1) create database with default page_size (8k)
2) run:
echo recreate table test(s varchar(2039) unique); set count on; insert into test select rpad('', 2039, uuid_to_char(gen_uuid())) from rdb$types, rdb$types; | isql /3333:e30 & gstat -r /3333:e30

Output of ISQL will be like this:

Statement failed, SQLSTATE = 54000
Implementation limit exceeded
-Maximum index level reached
Records affected: NNN

Output of "gstat -r":

TEST (135)
Primary pointer page: 179, Index root page: 185
Total formats: 1, used formats: 0
Average record length: 0.00, total records: 0
Average version length: 0.00, total versions: 0, max versions: 0
Average fragment length: 0.00, total fragments: 0, max fragments: 0
Average unpacked length: 0.00, compression ratio: 0.00
Pointer pages: 1, data page slots: 0
Data pages: 0, average fill: 0%
Primary pages: 0, secondary pages: 0, swept pages: 0
Empty pages: 0, full pages: 0
Fill distribution:
0 - 19% = 0
20 - 39% = 0
40 - 59% = 0
60 - 79% = 0
80 - 99% = 0

Index RDB$8 \(0\)
    Root page: 899, depth: 16, leaf buckets: 119, nodes: 0
    Average node length: 0\.00, total dup: 0, max dup: 0
    Average key length: 0\.00, compression ratio: 0\.00
    Average prefix length: 0\.00, average data length: 0\.00
    Clustering factor: 0, ratio: 0\.00
    Fill distribution:
         0 \- 19% = 1
        20 \- 39% = 118
        40 \- 59% = 0
        60 \- 79% = 0
        80 \- 99% = 0

===

All numbers for INDEX section should be zeroes because in fact none records have been added into the table.
PS. gfix -sweep does not help: non-zero values remain in gstat after it.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

issuetype: Improvement [ 4 ] => Bug [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Pavel,

gstat reports *correct* values.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

Then I can`t understand how can index have "depth: 16, leaf buckets: 119" while "nodes: 0" ? 8-O

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Pages are empty. Obvious, isn't it?

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

There is an issue with index GC algorithm : index could not release too many pages after all keys was deleted.
I observed it with big\huge keys and depth >= 5.
Must say that it doesn't show itself in "real life", thus i set "minor" priority.

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

priority: Major [ 3 ] => Minor [ 4 ]

assignee: Vlad Khorsun [ hvlad ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants