PostgreSQL 修改查询日期影响索引是否生效

2019-04-17 10:25:35 浏览数 (1)

创建索引原文:

CREATE INDEX "TheTickets_IssueTime_idx" ON "TheTickets" USING btree ("IssueTime")

执行第一次:

explain

select "Id" from "TheTickets"

where date("IssueTime") >='2019-01-01'

执行第二次:

explain

select "Id" from "TheTickets"

where date("IssueTime") >='2018-01-01'

执行结果如下图所示:

这就不懂了。。。

0 人点赞