Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explain() response should have user readable keys #17

Open
apkar opened this issue Nov 30, 2018 · 2 comments · May be fixed by #208
Open

explain() response should have user readable keys #17

apkar opened this issue Nov 30, 2018 · 2 comments · May be fixed by #208
Assignees

Comments

@apkar
Copy link
Contributor

apkar commented Nov 30, 2018

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.

@senthil-db-expert
Copy link

@apkar Please assign this ticket to me.
We think we could address this using the existing decode_key_part function

@apkar
Copy link
Contributor Author

apkar commented Aug 22, 2019

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.

drkannan added a commit to drkannan/fdb-document-layer that referenced this issue Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants