Fix disk_info accounting for hash indexes#631
Conversation
|
Much needed! Thank you for the contribution. or something similar should fix the lint. Note that Will try to get this in before the release since it fills an important gap. |
|
Bonus: add the hash index to |
|
@adsharma Thanks, yes will update it. |
a9b13cd to
380ebc2
Compare
|
@adsharma Could you review this. I also have couple of feature I would like to add. Is there any discord channel I can discuss this? Dependent PR LadybugDB/extensions#19 |
4e845d6 to
d19467e
Compare
|
Discord channel is linked from the bottom right corner of ladybugdb.com |
|
Merged the extension PR. Please reset the submodule to LadybugDB/extensions@3a45fc4 and the CI should be green after that. |
adsharma
left a comment
There was a problem hiding this comment.
Looks great. One minor comment.
Summary
This PR fixes hash index storage accounting in disk_info() / storage_info() and makes SHOW_INDEXES()
include the built-in _PK hash index so index visibility is consistent with the underlying storage state.
Problem
There were two related inconsistencies:
and shows up in storage-oriented views.
This made it harder to reason about index footprint and led to confusing gaps between catalog and
storage infrormation.
What changed
Expose hash index storage through Index::getStorageEntries()
Report logical hash index components such as:
Include the relevant disk-array page ranges so allocated hash index pages are accounted for correctly
Aggregate repeated disk_info() entries by logical component name instead of emitting a row per page/
range
Behavior after this change
SHOW_INDEXES() now reflects both user-created indexes and the built-in _PK hash index when present.
Example:
CALL SHOW_INDEXES() WHERE table_name = 't'
RETURN table_name, index_name, index_type, property_names
ORDER BY index_name;
Before:
t | t_name_idx | ART | [name]
After:
t | _PK | HASH | [id]
t | t_name_idx | ART | [name]
disk_info() stays summary-oriented and grouped by logical storage component.
storage_info() stays detailed and emits one row per physical storage range.