有几个方面需要考虑。
例如
检索是否走索引
排序是否走索引
pg_amop
Name Type References Description
oid oid Row identifier (hidden attribute; must be explicitly selected)
amopfamily oid pg_opfamily.oid The operator family this entry is for
amoplefttype oid pg_type.oid Left-hand input data type of operator
amoprighttype oid pg_type.oid Right-hand input data type of operator
amopstrategy int2 Operator strategy number
amoppurpose char Operator purpose, either s for search or o for ordering
amopopr oid pg_operator.oid OID of the operator
amopmethod oid pg_am.oid Index access method operator family is for
amopsortfamily oid pg_opfamily.oid The B-tree operator family this entry sorts according to, if an ordering operator; zero if a search operator
如果走索引的成本低,可以走索引。
或者使用了开关,禁止全表扫,也可以走索引。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。