SELECT `LOGFILE_GROUP_NAME` , `FILE_NAME` , `TOTAL_EXTENTS` , INITIAL_SIZE , ENGINE , `EXTRA` FROM `INFORMATION_SCHEMA` . `FILES` WHERE `FILE_TYPE` = ? AND `FILE_NAME` IS NOT NULL AND `LOGFILE_GROUP_NAME` IS NOT NULL AND `LOGFILE_GROUP_NAME` IN ( SELECT DISTINCTROW `LOGFILE_GROUP_NAME` FROM `INFORMATION_SCHEMA` . `FILES` WHERE `FILE_TYPE` = ? AND `TABLESPACE_NAME` IN ( SELECT DISTINCTROW `TABLESPACE_NAME` FROM `INFORMATION_SCHEMA` . `PARTITIONS` WHERE `TABLE_SCHEMA` IN (?) ) ) GROUP BY `LOGFILE_GROUP_NAME` , `FILE_NAME` , ENGINE , `TOTAL_EXTENTS` , INITIAL_SIZE ORDER BY `LOGFILE_GROUP_NAME` 