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

Optimimze json_extract queries #110

Open
killua-eu opened this issue Apr 27, 2019 · 0 comments
Open

Optimimze json_extract queries #110

killua-eu opened this issue Apr 27, 2019 · 0 comments

Comments

@killua-eu
Copy link
Collaborator

killua-eu commented Apr 27, 2019

Currently, accounting/costs listing uses a foreach to select vector names. We should just left_join to the vector table, to get vector names. Depends on

Right now, we'll stop at

SELECT c_uid,json_extract(json_extract(c_data,'$.data.managerial_acc'),'$[*].pixel_id') FROM `t_accounting_received` 

c_uid  json
39     ["man 1", "man 2"]
40     NULL

With mysql 8, we might just use https://dev.mysql.com/doc/refman/8.0/en/json-table-functions.html to convert the array and perform a convenient leftjoin on t_vectors

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

No branches or pull requests

1 participant