条件索引 本文为您介绍如何使用条件索引。 plaintext teledb create table tsex(id int,sex text) ; CREATE TABLE teledb teledb create index tsexsexidx on tsex (sex); CREATE INDEX teledb insert into tsex select t,'男' from generateseries(1,1000000) as t; INSERT 0 1000000 teledb insert into tsex select t,'女' from generateseries(1,100) as t; INSERT 0 100 teledb analyze tsex ; ANALYZE teledb explain select from tsex where sex '女'; QUERY PLAN Remote Fast Query Execution (cost0.00..0.00 rows0 width0) Node/s: dn01, dn02 > Index Scan using tsexsexidx on tsex (cost0.42..9.30 rows50 width8) Index Cond: (sex '女'::text) (4 rows)