Hello, While I am still looking at this WIP patch, I had one suggestion.
Instead of making changes in the index AM API can we have a call to update the shared state using pgstat_progress* API directly from specific index level code? Like pgstat_count_index_scan(rel) call from _bt_first does. Though this function basically updates local structures and sends the count to stat collector via messages we can have a function which will instead modify the shared state using the progress API committed recently. Thank you, Rahila Syed