Unable to find out table_id in sys_indexes

24 views
Skip to first unread message

Sudhir Shekhsaria

unread,
Jan 12, 2018, 5:49:46 AM1/12/18
to TwinDB
I was trying to get data back from ibdata files, I Generated sys_tables and sys_indexes stats , I am to find out index_id based on table_id but for two databases when tried to matched table_id in sys_indexes  I didn't found any info in it. can anyone one let me help to understand how to resolve it.


Aleksandr Kuzminsky

unread,
Jan 12, 2018, 12:34:40 PM1/12/18
to TwinDB
To find index_id you need to find table_id first.
If you have table name you can "grep" SYS_TABLES:

# grep sakila dumps/default/SYS_TABLES | head -5
0000000052D5    D9000002380110  SYS_TABLES  "sakila/actor"  753 4   1   0   80  ""  739
0000000052D8    DC0000014F0110  SYS_TABLES  "sakila/address"    754 8   1   0   80  ""  740
0000000052DB    DF000002CA0110  SYS_TABLES  "sakila/category"   755 3   1   0   80  ""  741
0000000052DE    E2000002F80110  SYS_TABLES  "sakila/city"   756 4   1   0   80  ""  742
0000000052E1    E5000002C50110  SYS_TABLES  "sakila/country"    757 3   1   0   80  ""  743

table_id comes right after a table name.
Once you have table_id you can look for index_id in SYS_INDEXES:

# grep 753 SYS_INDEXES

0000000052D5    D9000002380110  SYS_INDEXES 753 1828 PRIMARY 1 3 739 3
0000000052D8    DC0000014F0110  SYS_INDEXES 753 1829 idx_actor_last_name 1 0 739 4

So, 1828 is your index_id

See how to work with the dictionary on https://twindb.com/how-to-recover-innodb-dictionary/
Reply all
Reply to author
Forward
0 new messages