sql
sql copied to clipboard
Support reading value from docvalue
Would Opendistro SQL support reading docvalue fields? When only a small number of fields are read, performance would be greatly improved. Looking forward to this feature!
Thanks for reaching out. Could you give some example that how to use SQL to read docvalue?
@penghuo Thank you very much for your reply. For GroupBy
query, docvalue is used. So this issue mainly focuses on normal select query. IMO, there are two ways to do this:
- The best way is to automatically choose whether to use source or docvalue based on SQL.
- Another way is to allow users to choose to read from docvalue as follows:
SELECT DocValue('uid'), DocValue('timestamp'), DocValue('page_views') FROM index;
@penghuo Thank you very much for your reply. For
GroupBy
query, docvalue is used. So this issue mainly focuses on normal select query. IMO, there are two ways to do this:
- The best way is to automatically choose whether to use source or docvalue based on SQL.
- Another way is to allow users to choose to read from docvalue as follows:
SELECT DocValue('uid'), DocValue('timestamp'), DocValue('page_views') FROM index;
Thanks for the info! So what kind of ES DSL you expect to generate from the query you proposed? If this only concerns performance, ideally I think our query engine should take care of the performance behind the scene.