obviously the example is contrived, but it seems strange me that they are not storing the json in its own column - just extracting a single key from it and storing in a generated column. Why not do that in the app code if youre just going to discard the rest of the json? Here's an example i saw yesterday from mariadb, which is improving its json support in its upcoming releases. https://mariadb.com/docs/server/ha-and…
CREATE TABLE t1 (data JSONB);
INSERT INTO t1 VALUES ('{"column1":1234}');
CREATE INDEX t1column1 ON t1(data->'column1');
SELECT * FROM t1 WHERE data1->'column1' = '1234'; // not sure about data type