Bug #79073 Optimizer hint to disallow full scan

Submitted: 2 Nov 2015 13:09
Reporter: Daniël van Eeden Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S4 (Feature request)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: full scan, hints, Optimizer

[2 Nov 2015 13:09] Daniël van Eeden
Description:
Make it possible to add an optimizer hint to a query to disallow a full scan.

This helps if range_optimizer_max_mem_size is set to low and the optimizer chooses a full scan. The optimizer should make the query fail in that case instead of doing a very expensive full table scan.

Related: Bug #70299

How to repeat:
Try to do a query which might need more memory for the range optimizer than configured and let it fail if it hits this limit.

Suggested fix:
"DELETE /*+ NO_FULL_SCAN */ FROM …"
"DELETE /*+ FORCE_RANGE */ FROM …"
"DELETE /* MAX_SCAN_ROWS(100000) */ FROM …"? 

Looks like this is the Oracle DBMS syntax:
"DELETE /*+ INDEX_RS_ASC(PRIMARY) */ FROM …"
This forces a ascending range scan
[18 Jun 2016 21:28] Omer Barnir
Posted by developer:
 
Reported version value updated to reflect release name change from 5.8 to 8.0

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.052 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.