Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explain: print "FULL SCAN (SOFT LIMIT)" for full scans with soft limits #85421

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

michae2
Copy link
Collaborator

@michae2 michae2 commented Aug 1, 2022

Change EXPLAIN output of full scans with soft limits to
"FULL SCAN (SOFT LIMIT)" instead of "FULL SCAN". This will help
distinguish them from unlimited full scans.

So now we print three different messages for three kinds of full scans:

  • For full scans with hard limits we print "LIMITED SCAN".
  • For full scans with soft limits we print "FULL SCAN (SOFT LIMIT)".
  • For unlimited full scans we print "FULL SCAN".

Release note (sql change): Change EXPLAIN output of full scans with
soft limits to "FULL SCAN (SOFT LIMIT)" instead of "FULL SCAN", to
distinguish them from unlimited full scans. Unlimited full scans always
scan the entire index. Full scans with soft limits could scan the entire
index, but usually halt early once enough rows have been found to
satisfy their parent operator.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@michae2 michae2 requested review from rytaft and msirek August 2, 2022 04:16
@michae2 michae2 marked this pull request as ready for review August 2, 2022 04:16
@michae2 michae2 requested a review from a team as a code owner August 2, 2022 04:16
Copy link
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LIMITED FULL SCAN sounds a bit like a contradiction, but I'm struggling to think of a better idea. cc @vy-ton and @kevin-v-ngo for awareness and in case you guys have an idea about how to make this more clear.

Reviewed 10 of 10 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @msirek)

@michae2
Copy link
Collaborator Author

michae2 commented Aug 2, 2022

LIMITED FULL SCAN sounds a bit like a contradiction, but I'm struggling to think of a better idea. cc @vy-ton and @kevin-v-ngo for awareness and in case you guys have an idea about how to make this more clear.

Yeah, I was also struggling to come up with something better. I also thought about POTENTIALLY-LIMITED FULL SCAN and SHORT-CIRCUITING FULL SCAN and FULL SCAN (SOFT LIMIT) but these all seemed too verbose. I'm open to any suggestions!

Copy link
Collaborator

@mgartner mgartner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Some more ideas to throw into the mix: HALTABLE FULL SCAN or HALTING FULL SCAN. I also thought of PREEMPTIBLE FULL SCAN but I think preemption would mean stopping the scan and restarting it later.

Reviewed 10 of 10 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @msirek)

@michae2
Copy link
Collaborator Author

michae2 commented Aug 2, 2022

The more I think about it, the more I dislike LIMITED FULL SCAN. How do people feel about POSSIBLE FULL SCAN?

@DrewKimball
Copy link
Collaborator

DrewKimball commented Aug 2, 2022

FULL SCAN (SOFT LIMIT) seems most intuitive to me. Another option might be SOFT LIMIT SCAN or SOFT LIMITED SCAN if we're ok with losing the FULL. PIPELINED FULL SCAN is another possibility, though maybe that one is too far removed from LIMIT.

How do people feel about POSSIBLE FULL SCAN?

POSSIBLE FULL SCAN and POTENTIAL FULL SCAN also sound good.

@mgartner
Copy link
Collaborator

mgartner commented Aug 2, 2022

I like FULL SCAN (SOFT LIMIT), though we'd have to educate users what "soft limit" means because I don't think it'd be immediately obvious to most.

@rytaft
Copy link
Collaborator

rytaft commented Aug 2, 2022

I also like FULL SCAN (SOFT LIMIT). That seems to me like the best of the options we've discussed. We'll need to make sure the docs are updated to explain it cc @taroface who will be taking over SQL Queries docs soon.

Change `EXPLAIN` output of full scans with soft limits to
"FULL SCAN (SOFT LIMIT)" instead of "FULL SCAN". This will help
distinguish them from unlimited full scans.

So now we print three different messages for three kinds of full scans:
- For full scans with hard limits we print "LIMITED SCAN".
- For full scans with soft limits we print "FULL SCAN (SOFT LIMIT)".
- For unlimited full scans we print "FULL SCAN".

Release note (sql change): Change `EXPLAIN` output of full scans with
soft limits to "FULL SCAN (SOFT LIMIT)" instead of "FULL SCAN", to
distinguish them from unlimited full scans. Unlimited full scans always
scan the entire index. Full scans with soft limits could scan the entire
index, but usually halt early once enough rows have been found to
satisfy their parent operator.
@michae2 michae2 changed the title sql/opt: show LIMITED FULL SCAN for full scans with soft limits explain: print "FULL SCAN (SOFT LIMIT)" for full scans with soft limits Aug 2, 2022
@michae2
Copy link
Collaborator Author

michae2 commented Aug 2, 2022

Thanks for the feedback, everyone!

bors r=rytaft,mgartner

@craig
Copy link
Contributor

craig bot commented Aug 2, 2022

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants