> The JSON interface is like, “we save the text and when you retrieve it we parse the JSON at several hundred MB/s and let you do path queries against it please stop overthinking it, this is filing cabinet.”
> The JSON interface is like, “we save the text and when you retrieve it we parse the JSON at several hundred MB/s and let you do path queries against it please stop overthinking it, this is filing cabinet.”
For example, on 1M rows table with very simple flat JSON values like these:
{"object": "user", "object_id": 10, "action": "login"}
Without index, this query is going to take 500ms or more: select * from events where json_extract(value, '$.object_id') = ?;
With index on json_extract(value, '$.object_id'), it is going to take 1ms.See for yourself:
https://grafana.com/docs/loki/latest/best-practices/
”don’t add a label for something until you know you need it! Use filter expressions and brute force those logs. It works – and it’s fast.“
Now I don’t advocate brute forcing text as a replacement for a database. But for filing cabinets, like logs with very unpredictable formats, that some admin will look at every once in a blue moon, those 500ms extra per query are nothing. Put it in relation to someone doing it completely manually.