日本: 03-5843-1141
USA - Toll Free: +1-866-221-0634
USA - From abroad: +1-408-701-9009
USA - Subscription Renewals: +1-866-830-4410
UK: +44 845 399 1124
Ireland: +353 1 6919191
Germany: +49 89 420 95 98 95
France: +33 1 70 61 48 95
Sweden: +46 730 207 871
Benelux: +358 50 5710 528
Italy: +39 06-99268193
Israel: +358 50 5710 528
Spain & Portugal: + 34 933905461
Other EMEA countries: +353 1 6919191
Asia Pacific: +81 3 5843 1141
MySQL の新しいリリース、技術情報、イベントなどの情報が記載されています。
毎月発行される MySQL ニュースレターを購読しませんか?
Newsletters older than 6 months may have links that are out of date. Please use the Search to check for updated links.
How can you calculate btree index depth?
Start with myisamchk -dvv table_file
....
Data records: 405
....
Datafile pointer (bytes): 4 Keyfile pointer (bytes): 4
....
table description:
Key Start Len Index Type Rec/key Root Blocksize
1 2 4 unique unsigned long 1 7168 1024
2 6 100 unique char packed stripped NULL 0 4096 1024
261 100 char stripped NULL 0
....
So - Blocksize (for key) - 1024.
Key length is (key length)+(Datafile pointer)+(Keyfile pointer). Keyfile pointer is omitted in leaf pages, but let's disregard it for simplicity.
So - 405 entries, 4+4+4=12 entry size, 1024 page size. Depth is log(405)/log(1024/12) = 1.35
The second key is not that easy. 100+100 is maximal length, but keys are space stripped and packed, so actual length is much less. Anyway, depth is not bigger than log(405)/log(1024/208) < 4.
