From: Nirgal V. <con...@ni...> - 2011-03-06 11:10:48
|
I tried to make a patch out of all that, since there is some really good stuff, and I believe it's easier for Brian to merge. I discarded a few things, like the renaming of fields, because it would not match the source code anymore. It's complex enough reading it... HACKING does help. On Monday 28 February 2011 08:25:17 dw wrote: > 8) The definitions for index information seem to be wrong. > (...) > Lastly > | ???? | 1 byte | primary_key | 0x01 if this index is primary | > Should be > | ???? | 1 byte | index_flags | see MDB_IDX_* flags | I disagree with that one. The flags are above, in the jet3 39 bytes index blocks, ot jet 4 52 bytes one. > So, when walking the list of index definitions, you use num_idx to tell > you how many indices there are. Then for each index, you use > index_Cols_index to index into the column definitions table to find the > columns for that index. The reason num_idx and num_idx_col might be > different is not because some of the indices are "real" (whatever that > was supposed to mean), but simply because more than one index uses the > same column list. I've seen this happen if there is one index that > includes nulls, and one that doesn't. FYI Type 2 extra "indexes" are the reverse of contraints, probably used to optimized cascade updates. These ones don't have matching columns definitions blocks. > I have a re-written mdb_read_indices that (I believe) correctly parses > this data if anyone is interested. It wouldn't hurt to publish that to the list, would it? I did that several times, and often had bad surprises, like when there are so many indexes that index definitions cover several DB pages... |