Bug #7940 --log-queries-not-using-indexes with option to exclude non conditional querry
Submitted: 16 Jan 2005 16:37 Modified: 16 Sep 2006 10:03
Reporter: Martin Friebe (Gold Quality Contributor) (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Logging Severity:S4 (Feature request)
Version:- OS:Any (-)
Assigned to: CPU Architecture:Any
Triage: Triaged: D5 (Feature request)

[16 Jan 2005 16:37] Martin Friebe
Description:
just an idea abou the option --log-queries-not-using-indexes:
it might be usefull to have an option to specify, if queries that do not contain any condition (no join, no where) should be matched by  --log-queries-not-using-indexes.
Those queries are obviously not expected to use an index (and would still be caught by the time constraints, if required).

related but not equal feature requests:
#3274   Slow query log and no index log
#2588  	Allow filtering of messages logged (general query log)
related bug
#7939  	 --log-queries-not-using-indexes doesnt apply with 0 or 1 row OR quuery cache

How to repeat:
create table t1 (a integer);
insert into t1 values (1),(2),(3);
select * from t1;

# obviously, you do not expect the query to use an index
# you might if a, was an index, and expect to read only values from the index, but an option would be nice

Suggested fix:
if considered useful, add such an option.

thanks
[16 Sep 2006 10:03] Valeriy Kravchuk
Thank you for a reasonable feature request.
[1 Mar 2008 15:51] Alan Tam
Since it is the query writer who decides whether a query should do table scan or not, I would recommend we embed the option directly inside the SQL, like SQL_CACHE.

SELECT SQL_TABLE_SCAN * FROM Table;