Re: [PERFORM] Index not being used on composite type for particular query

2017-05-20 Thread Zac Goldstein
Thanks for the fast reply and explanation, Tom. Overall, I have been pleasantly surprised with the leniency of indexes on range types. On Sat, May 20, 2017 at 5:00 PM, Tom Lane wrote: > Zac Goldstein writes: > > This uses the index: > > ... > > But this doesn't: > > > EXPLAIN (ANALYZE, BUF

Re: [PERFORM] Index not being used on composite type for particular query

2017-05-20 Thread Tom Lane
Zac Goldstein writes: > This uses the index: > ... > But this doesn't: > EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM shot > WHERE lower(shot.matchsecond) <@ ((shot.matchsecond).match_id, > numrange(5, 10))::matchsecond_type; Well, yeah. After inlining the SQL functions, what you have is >