my only concern is that this code is now called for every row file and it makes an entirely new pruning predicate (even when there is no limit and thus the results aren't used). Could we only run this code when there is a limit?
Originally posted by @alamb in #18868 (comment)