>>=# EXPLAIN (VERBOSE, ANALYZE) SELECT * FROM test WHERE id1 = 1 AND id3 = 101;
>> QUERY PLAN
>>-------------------------------------------------------------------------------------------------------------------------------
>> Index Scan using test_idx on ikedamsh.test (cost=0.42..12630.10 rows=1 width=18) (actual time=0.175..279.819 rows=1
loops=1)
>> Output: id1, id2, id3, value
>> Index Cond: (test.id1 = 1) -- Change the output. Show only the bound quals.
>> Index Filter: (test.id3 = 101) -- New. Output quals which are not used as the bound quals
>> Rows Removed by Index Filter: 499999 -- New. Output when ANALYZE option is specified
>> Planning Time: 0.354 ms
>> Execution Time: 279.908 ms
>> (7 rows)
>
> I don't think we want to split these clauses. Index Cond should indicate the conditions applied
> to the index scan. Bound quals should be listed separately even though they will have an
> intersection with Index Cond. I am not sure whether Index Filter is the right name,
> maybe Index Bound Cond: But I don't know this area enough to make a final call.
OK, I understood that it's better to only add new ones. I think "Index Filter" fits other than "Index
Bound Cond" if we introduce "Rows Removed By Index Filter".
> About Rows Removed by Index Filter: it's good to provide a number when ANALYZE is
> specified, but it will be also better to specify what was estimated. We do that for (cost snd rows etc.)
> but doing that somewhere in the plan output may not have a precedent. I think we should try that
> and see what others think.
It's interesting! It’s an idea that can be applied not only to multi-column indexes, right?
I will consider the implementation and discuss it in a new thread. However, I would like to
focus on the feature to output information about multi-column indexes at first.
Regards,
--
Masahiro Ikeda
NTT DATA CORPORATION