vaizard / glued-archived

1 stars 3 forks source link

Optimimze json_extract queries #110

Open killua-eu opened 5 years ago

killua-eu commented 5 years ago

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