On Thu, 16 Jul 2020 at 07:52, Floris Van Nee <florisvannee@optiver.com> wrote:
>
> Besides the great efforts that Dmitry et al. are putting into the skip scan for DISTINCT queries [1], I’m also still
keenon extending the use of it further. I’d like to address the limited cases in which skipping can occur here. A few
monthsago I shared an initial rough patch that provided a generic skip implementation, but lacked the proper planning
work[2]. I’d like to share a second patch set that provides an implementation of the planner as well. Perhaps this can
leadto some proper discussions how we’d like to shape this patch further.
>
> Please see [2] for an introduction and some rough performance comparisons. This patch improves upon those, because it
implementsproper cost estimation logic. It will now only choose the skip scan if it’s deemed to be cheaper than using a
regularindex scan. Other than that, all the features are still there. The skip scan can be used in many more types of
queriesthan in the original DISTINCT patch as provided in [1], making it more performant and also more predictable for
users.
>
> I’m keen on receiving feedback on this idea and on the patch.
I don't think anyone ever thought the feature would be limited to just
making DISTINCT go faster. There's certain to be more usages in the
future.
However, for me it would be premature to look at this now.
David