Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5.1
-
None
-
linux
Description
this statement fails in database information_schema
ALTER TABLE TABLES ADD UNIQUE INDEX UK_TABLES(TABLE_SCHEMA, TABLE_NAME);
Right now the statement below, which I use hundreds of times per second, is performing a full table scan
SELECT AUTO_INCREMENT - 1 FROM INFORMATION_SCHEMA.TABLES where table_schema ='x' and table_name='y')
I could add an index but it does not allow me any such privileges. It should allow me to improve the internal tables.
I use this statement because I need to know inside a stored procedure which is the highest ID in the table. To do full count or a max(ID) is slower than the statement above. Am I wrong?