3 ms·
With a GIN index and a JSONB column you can index the entire json document. It's the same index type as Postgres uses for the full text search, but not super ef
by sitharus 8y ago
With a GIN index and a JSONB column you can index the entire json document. It's the same index type as Postgres uses for the full text search, but not super efficient. You can also project out specific subsets of the document to an index and Postgres will use them.
- h1d 8y agoI take it this is Postgres specific and MySQL can't index JSON items.
- sitharus 8y agoI'm not familiar with MySQL but the features I outlined are Postgres specific.
- evanelias 8y agoThe syntax and terminology are different, but MySQL has supported indexes on values inside of JSON (or any arbitrary expression/function) since MySQL 5.7, released about three years ago. In MySQL, you can define a "generated column" and index it in InnoDB. https://dev.mysql.com/doc/refman/5.7/en/create-table-secondary-indexes.html https://dev.mysql.com/doc/refman/5.7/en/create-table-seconda... contains some JSON-specific examples.