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

sql: don't apply disallow_full_table_scans to virtual tables #122708

Closed
DrewKimball opened this issue Apr 19, 2024 · 0 comments · Fixed by #123780
Closed

sql: don't apply disallow_full_table_scans to virtual tables #122708

DrewKimball opened this issue Apr 19, 2024 · 0 comments · Fixed by #123780
Assignees
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-support Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs P-2 Issues/test failures with a fix SLA of 3 months T-sql-queries SQL Queries Team

Comments

@DrewKimball
Copy link
Collaborator

DrewKimball commented Apr 19, 2024

Since we currently don't collect stats for virtual tables, (tracked in #27611), we unconditionally apply costing changes due to the disallow_full_table_scans setting for virtual table scans, even if large_full_scan_rows is larger than the row count. Until tracked in #27611 is fixed, we should prevent disallow_full_table_scans from applying to virtual tables, likely using a setting.

Jira issue: CRDB-38031

@DrewKimball DrewKimball added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-support Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs T-sql-queries SQL Queries Team labels Apr 19, 2024
@github-project-automation github-project-automation bot moved this to Triage in SQL Queries Apr 19, 2024
@rytaft rytaft added the P-2 Issues/test failures with a fix SLA of 3 months label May 6, 2024
@yuzefovich yuzefovich moved this from Triage to 24.2 Release in SQL Queries May 7, 2024
@yuzefovich yuzefovich self-assigned this May 7, 2024
@yuzefovich yuzefovich moved this from 24.2 Release to Active in SQL Queries May 7, 2024
@craig craig bot closed this as completed in e0951b9 May 9, 2024
@github-project-automation github-project-automation bot moved this from Active to Done in SQL Queries May 9, 2024
michae2 added a commit to michae2/cockroach that referenced this issue Sep 19, 2024
In cockroachdb#69371 we set the default for `large_full_scan_rows` to 1000. This
default can be surprising for users of `disallow_full_table_scans`. Now
that cockroachdb#122708 is fixed, let's set the default to 0 so that the exemption
for small tables is opt-in rather than opt-out.

Fixes: cockroachdb#130726

Release note (sql change): Set the default for session variable
`large_full_scan_rows` to 0. This means that by default,
`disallow_full_table_scans` will disallow _all_ full table scans, even
full scans on very small tables.
michae2 added a commit to michae2/cockroach that referenced this issue Sep 20, 2024
In cockroachdb#69371 we set the default for `large_full_scan_rows` to 1000. This
default can be surprising for users of `disallow_full_table_scans`. Now
that cockroachdb#122708 is fixed, let's set the default to 0 so that the exemption
for small tables is opt-in rather than opt-out.

Fixes: cockroachdb#130726

Release note (sql change): Set the default for session variable
`large_full_scan_rows` to 0. This means that by default,
`disallow_full_table_scans` will disallow _all_ full table scans, even
full scans on very small tables. If `large_full_scan_rows` is set > 0,
`disallow_full_table_scans` will allow full scans estimated to read
fewer than `large_full_scan_rows`.
craig bot pushed a commit that referenced this issue Sep 20, 2024
131040: sql: set default for large_full_scan_rows to 0 r=mgartner a=michae2

In #69371 we set the default for `large_full_scan_rows` to 1000. This default can be surprising for users of `disallow_full_table_scans`. Now that #122708 is fixed, let's set the default to 0 so that the exemption for small tables is opt-in rather than opt-out.

Fixes: #130726

Release note (sql change): Set the default for session variable `large_full_scan_rows` to 0. This means that by default, `disallow_full_table_scans` will disallow _all_ full table scans, even full scans on very small tables. If `large_full_scan_rows` is set > 0, `disallow_full_table_scans` will allow full scans estimated to read fewer than `large_full_scan_rows`.

Co-authored-by: Michael Erickson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-support Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs P-2 Issues/test failures with a fix SLA of 3 months T-sql-queries SQL Queries Team
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants