On Mar 27, 2018, at 12:46 AM, rene <[email protected]> wrote:
> 
> "arrayname" : [
>  {
>    "name" : "unique_name",
>    "id" : 1,
>    ...
>  },
>  ..
> ]

That looks like

    CREATE TABLE arrayname (
       Id INTEGER NOT NULL PRIMARY KEY,
       name TEXT NOT NULL,
       etc INTEGER...
    );

to me.

The point of JSON support in SQLite, IMHO, is that it allows for hierarchical 
data structures, not something that is easy to do in a relational table-based 
DBMS like SQLite otherwise.

But, you’ve just got tables of flat records, exactly what SQLite normally 
stores, so why not just leverage the power it already gives you?

In other words, do the JSON parsing in the process that populates the SQLite 
DB, don’t make SQLite do the JSON parsing repeatedly for you.

> Question 1: Is it possible to create an index on "name" and "id" inside
> sqlite

It is if you normalize the data on ingest as I suggest above.

> Question 2: Can I speed up the reading of the values.

Normalized, parsed, and indexed data should query far faster than 
repeatedly-parsed JSON strings.

_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to