### Why is this PR needed?
In the existing architecture, if the parent(main) table and SI table don’t have the same valid segments then we disable the SI table. And then from the next query onwards, we scan and prune only the parent table until we trigger the next load or REINDEX command (as these commands will make the parent and SI table segments in sync). Because of this, queries take more time to give the result when SI is disabled.
### What changes were proposed in this PR?
1. Instead of disabling the SI table(when parent and child table segments are not in sync) we will do pruning on SI tables for all the valid segments(segments with status success, marked for update and load partial success) and the rest of the segments will be pruned by the parent table.
2. Now, different SI tables may contain different numbers of segments. In that case, made the changes to identify the best fit SI table based on segment count. If more than one SI table contains the same segment count then identify the best fit SI table based on the current design.
### Does this PR introduce any user interface change?
### Is any new testcase added?
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at: