DrRichCarpenter / check-unused-keys

Automatically exported from code.google.com/p/check-unused-keys
0 stars 0 forks source link

Feature Request - Check-Unused-Tables #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is a feature request, not a bug.

Checking unused indexes in conjunction with the Google User Stats patch has 
proved invaluable given my work environment (and developers) are dynamic 
and the ratio of developers to dba's is very lopsided.  It'd be great to 
see the current tool enhanced with more features like check-unused-tables.  
At first glance the value would be faster backups, quicker restores and 
decrease the time to open tables for InnoDB (due to serialization; granted 
it's the first time opening a table).

SELECT DISTINCT  
s.TABLE_SCHEMA,  
s.TABLE_NAME  
FROM information_schema.statistics s
    LEFT JOIN information_schema.table_statistics TBS ON 
(s.TABLE_SCHEMA = TBS.TABLE_SCHEMA AND s.TABLE_NAME=TBS.TABLE_NAME) 
WHERE TBS.TABLE_SCHEMA IS NULL;

Regards,
Sean

Original issue reported on code.google.com by sean.chi...@gmail.com on 23 Oct 2009 at 11:26

GoogleCodeExporter commented 9 years ago
N/M... further usage of check-unused-keys show this option.  Problem solved :)

--[no]print-unused-tables
  Whether or not to print a list of unused tables (indexes from unused tables are never 
shown)

Original comment by sean.chi...@gmail.com on 23 Oct 2009 at 11:33

GoogleCodeExporter commented 9 years ago
Sean,

I'm sort of hijacking this issue because --[no]print-unused-tables is reporting
incorrect tables in some cases.  I hope to have this issue resolved in a few 
hours.

-- Ryan Lowe

Original comment by ryan.a.l...@gmail.com on 29 Oct 2009 at 12:33

GoogleCodeExporter commented 9 years ago
Great, I'd me more than happy to help test it when you're ready.

--Sean

Original comment by sean.chi...@gmail.com on 12 Nov 2009 at 6:46

GoogleCodeExporter commented 9 years ago

Original comment by ryan.a.l...@gmail.com on 14 Nov 2009 at 6:16