simagix/keyhole

Compound Indexes mistakenly flagged as redundant

micajuine-ho opened this issue · 2 comments

Command: keyhole -index "connectionString"

Test case from compound indexes from the same collection:
Fields 1: {a:1, b:1, d:1}
Fields 2: {a:1, b:1, c:1, d:1}

The first compound index gets flagged as redundant b/c all of the fields in it are contained by the second compound indexes fields.

However, I believe this is incorrect according to the MonogDB docs on prefixes -- instead, to be fully redundant, the fields of compound index 2 would need to be {a:1, b:1, d:1, c:1}, b/c order matters.

works as designed and flagged as a reference.

Hi @simagix can you please explain what you mean by works as designed? Is the algorithm not supposed to take in the order of fields in account?