Search one array element with another
You seem to run the query on the view. Should be substantially faster based on underlying tables. Like:

SELECT DISTINCT parent_id
FROM   children_parent_tab
WHERE  children_id = ANY ('{1,2,3,4,5}'::int[]);


Details depend on undisclosed exact table definitions and requirements.

Be that as it may, you can fix the query you presented with the "overlap" operator &amp;&amp; instead of the "contains" operator @&gt;:

SELECT * FROM parent p WHERE ARRAY[1,2,3,4,5]::int[] &amp;&amp; children_ids;


This way you get all parents of any of the children in the given array.