A GIN index stores entries for components inside a value. For JSONB, the default jsonb_ops operator class supports key-existence operators and containment. jsonb_path_ops supports containment and JSON-path matching with a different set of indexed information, but it doesn't support the top-level ? key-existence operator.
Choose the operator class for the workload instead of assuming every GIN index has the same behavior. An expression GIN index on payload->'tags' can serve tag-array containment when the query uses that expression. A whole-document index and an expression index are different access paths.
GIN indexes add maintenance work to writes. Measure a representative query and update pattern before applying one to every document column. This lesson creates real PostgreSQL GIN indexes and checks their definitions. Small fixture timings aren't a benchmark of production document search.
Default JSONB GIN supports key existence as well as containment.