I built a query:
and an EVI that I'd hope would be useful.
Sure enough, the EVI was used to satisfy the query. However, in VE, I notice the following:
Aggregation Section, COUNT columns showed:
Count(Case When KORITDOR_T_1.KITTYP>Cast(1 AS Numeric(1,0)) Then 1 Else 0 End), Count(Case When KORITDOR_T_1.KITTYP<=Cast(1 AS Numeric(1,0)) Then 1 Else 0 End)
So I though, let's try using COUNT directly...
To my surprise, the EVI wasn't used. Instead the system built a temporary index.
I'm perfectly happy using the first form, but for my own understanding I'm wondering if somebody could explain why the EVI wasn't used for the second form.
Note: I'm also playing with including aggregates in the EVI itself.