CREATE TABLE mytable (
id SERIAL PRIMARY KEY,
name VARCHAR(255),
category_ids INT[]
);
CREATE INDEX mytable_category_ids_elem_idx ON mytable USING gin ((unnest(category_ids)));
我明白了
SQL Error [0A000]: ERROR: set-returning functions are not allowed in index expressions Position: 67
我想加快我的查询,其中有这个条款:
WHERE category_ids = '{1,2,3}'