fdb-document-layer
fdb-document-layer copied to clipboard
explain() response should have user readable keys
explain()
return information about query plan. Whether an index is being used or not, and how the scan is being used. Right now, it looks something like this
In [13]: db.correctness475041058659.find({'A': { 'A': None, 'C': {}}}).explain()
Out[13]:
{u'explanation': {u'source_plan': {u'projection': u'{}',
u'source_plan': {u'bounds': {u'begin': u'3\\x10\\x00\\xff\\x00\\xff\\x00\\xff\\x0aA\\x00\\xff\\x03C\\x00\\xff\\x05\\x00\\xff\\x00\\xff\\x00\\xff\\x00\\xff\\x00\\xff\\x00',
u'end': u'3\\x10\\x00\\xff\\x00\\xff\\x00\\xff\\x0aA\\x00\\xff\\x03C\\x00\\xff\\x05\\x00\\xff\\x00\\xff\\x00\\xff\\x00\\xff\\x00\\xff\\x00'},
u'index name': u'A_1_B_1_B_1',
u'type': u'index scan'},
u'type': u'projection'},
u'type': u'non-isolated'}}
Although, this gives an overview of what’s going on. It will be much more useful if the keys are user readable, instead of FDB keys.
@apkar Please assign this ticket to me. We think we could address this using the existing decode_key_part function
explain()
doesn't have to include the entire FDB key. As the FDB key contains the prefix pointing to collection or index as well. Make sure to remove the prefix.