1
为什么jsonb列上的gin索引减慢了查询速度,我该怎么办?
初始化测试数据: CREATE EXTENSION IF NOT EXISTS pgcrypto; CREATE TABLE docs (data JSONB NOT NULL DEFAULT '{}'); -- generate 200k documents, ~half with type: "type1" and another half with type: "type2", unique incremented index and random uuid per each row INSERT INTO docs (data) SELECT json_build_object('id', gen_random_uuid(), 'type', (CASE WHEN random() …