Based on my experiments, Postgres switches from scanning the list to a hash when the array size > 8.
77 karma · joined April 26, 2023
"We used a PostgreSQL v14 database on a db.t3.medium Amazon RDS instance equipped with 2 CPUs and 4GB RAM. The storage capacity is 200GB (gp2 storage)."