scripts/collector/mysql/sql/config.sql [124:169]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            from (
                select t.table_schema as table_schema,
                  t.table_name as table_name,
                  t.table_rows as table_rows,
                  t.DATA_LENGTH as DATA_LENGTH,
                  t.INDEX_LENGTH as INDEX_LENGTH,
                  t.DATA_LENGTH + t.INDEX_LENGTH as total_length,
                  t.ROW_FORMAT as row_format,
                  t.TABLE_TYPE as table_type,
                  t.ENGINE as table_engine,
                  if(pks.table_name is not null, 1, 0) as has_primary_key
                from information_schema.TABLES t
                  left join (
                    select table_schema,
                      TABLE_NAME
                    from information_schema.statistics
                    where table_schema not in (
                        'mysql',
                        'information_schema',
                        'performance_schema',
                        'sys'
                      )
                    group by table_schema,
                      TABLE_NAME,
                      index_name
                    having SUM(
                        if(
                          non_unique = 0
                          and NULLABLE != 'YES',
                          1,
                          0
                        )
                      ) = count(*)
                  ) pks on (
                    t.table_schema = pks.table_schema
                    and t.TABLE_NAME = pks.TABLE_NAME
                  )
                where t.table_schema not in (
                    'mysql',
                    'information_schema',
                    'performance_schema',
                    'sys'
                  )
              ) user_tables
          ) data_summary
        union
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/dma/collector/sql/sources/mysql/collection-config.sql [177:222]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            from (
                select t.table_schema as table_schema,
                  t.table_name as table_name,
                  t.table_rows as table_rows,
                  t.DATA_LENGTH as DATA_LENGTH,
                  t.INDEX_LENGTH as INDEX_LENGTH,
                  t.DATA_LENGTH + t.INDEX_LENGTH as total_length,
                  t.ROW_FORMAT as row_format,
                  t.TABLE_TYPE as table_type,
                  t.ENGINE as table_engine,
                  if(pks.table_name is not null, 1, 0) as has_primary_key
                from information_schema.TABLES t
                  left join (
                    select table_schema,
                      TABLE_NAME
                    from information_schema.statistics
                    where table_schema not in (
                        'mysql',
                        'information_schema',
                        'performance_schema',
                        'sys'
                      )
                    group by table_schema,
                      TABLE_NAME,
                      index_name
                    having SUM(
                        if(
                          non_unique = 0
                          and NULLABLE != 'YES',
                          1,
                          0
                        )
                      ) = count(*)
                  ) pks on (
                    t.table_schema = pks.table_schema
                    and t.TABLE_NAME = pks.TABLE_NAME
                  )
                where t.table_schema not in (
                    'mysql',
                    'information_schema',
                    'performance_schema',
                    'sys'
                  )
              ) user_tables
          ) data_summary
        union
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



