Thread: Use index with x = ANY(array_column) expression

Use index with x = ANY(array_column) expression

From
Havasvölgyi Ottó
Date:
Hi all,

Is there a way to speed up ANY-based array element search with some kind of index?
I mean this:

WHERE <parameter> = ANY(<array_column>)

Or is GIN index the only option with the @> operator?

WHERE <array_column> @> ARRAY[<parameter>]

Thank you,
Otto