query behaviour of composite gin index
If you want to see how the query will be run, you should put "EXPLAIN" before the "SELECT" and it will give you the execution plan.

There are three ways it could use the gin index:


It could look up just the location_id that you specify, then fetch those rows and filter out ones not containing 222.  
It could look up just the idle_products you specify, then fetch those rows and filter out ones not containing one of your location_id list.
It could look up all the index entries for 222, and all the index entries for your location_id list, and take the intersection of those to go fetch from the table.


It will choose which of those it thinks will work better, based on what it knows about your data distribution.

Also, I don't find composite gin indexes to be useful.  Having separate indexes is more flexible, and PostgreSQL can still combine them (using BitmapAnd) when that is useful to do.  I'd replace the composite index with a ordinary btree index on location_id and a gin index on the array column.