We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0fc086 commit b64930bCopy full SHA for b64930b
202112/20211224_05.md
@@ -19,7 +19,7 @@ PostgreSQL , 热门问题
19
## 链接、驱动、SQL
20
21
#### 24、为什么与检索字段类型不一致的输入条件有时可能不能采用索引?
22
-
+https://www.bilibili.com/video/BV1ju411m7J9/
23
24
例如:
25
- 被索引的字段是int4, 但是输入的where 条件是int8.
@@ -117,8 +117,8 @@ postgres=# explain select * from a where c4='1'::numeric;
117
是否使用索引:
118
119
1、列出所有的同名op, 有没有op直接支持这两种类型?
120
-- 有就跳到3
121
-- 没有就跳到2
+- 有就跳到3, 去判断索引的ops里面有没有包含这个op.
+- 没有就跳到2, 去寻求隐式转换.
122
123
2、在这些op中, 找到与字段类型一致的op, 并且尝试将变量类型转换为op里面对应的类型. (要求存在隐式转换).
124
例如1 `select * from a where id='1'::int8;` 要的是 `=(numeric,int8)`
0 commit comments