top | item 43944654

(no title)

Hakkin | 9 months ago

Note that you don't actually need the generated column either, SQLite supports indexes on expressions, so you can do, for example,

  CREATE INDEX subjectidx ON messages(json_extract(headers, '$.Subject'))
and it will use this index anywhere you reference that expression.

I find it useful to create indexes like this, then create VIEWs using these expressions instead of ALTER'ing the main table with generated columns.

discuss

order

randito|9 months ago

What a great timely tip. Was just looking for good direction on how to do this. Thanks!