> On Mar 26, 2019, at 10:41 AM, Warren Young <war...@etr-usa.com> wrote:
> 
> The biggest problem with these isn’t the use of JSON per se, it’s that each 
> one is unindexed, so they’ll all be a full table scan. 

Well, we don’t know that; the question was just about whether those are 
reasonable queries, not whether they can be indexed.

> You should be able to create indices on expressions like “json_extract(json, 
> '$.bar')”, but you’ll want to test it to find out whether the space it takes 
> is worth the speed increase.

The index takes exactly the same amount of space as it would if ‘bar’ were a 
regular SQL column.

> Even better would be to simply choose not to store all of your data in JSON 
> form

It depends on the use case. The nice thing about storing data as JSON is that 
there’s total flexibility of the schema of that data; you can change the way 
the data is structured without having to alter the database. (Except to add new 
indexes as needed for performance.)

—Jens
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to