on my machine the array[] is always slightly slower then '{}' one:
so=# do $$
declare
t text;
ts timestamptz;
begin
for n in 1..10 loop
select clock_timestamp() into ts;
for i in 1..99999 loop
execute format($f$select array['18%s-01-01'::date, '18%s-02-02']$f$,i,i) into t;
end loop;
raise info '%', t||' "[" '||clock_timestamp() - ts;
select clock_timestamp() into ts;
for i in 1..99999 loop
execute format($f$select '{18%s-01-01,18%s-02-02}'::date[]$f$,i,i) into t;
end loop;
raise info '%', t||' "{" '||clock_timestamp() - ts;
end loop;
end; $$;
INFO: {1899999-01-01,1899999-02-02} "[" 00:00:01.99259
INFO: {1899999-01-01,1899999-02-02} "{" 00:00:01.691473
INFO: {1899999-01-01,1899999-02-02} "[" 00:00:02.207583
INFO: {1899999-01-01,1899999-02-02} "{" 00:00:01.762358
INFO: {1899999-01-01,1899999-02-02} "[" 00:00:01.926091
INFO: {1899999-01-01,1899999-02-02} "{" 00:00:01.685358
INFO: {1899999-01-01,1899999-02-02} "[" 00:00:01.98542
INFO: {1899999-01-01,1899999-02-02} "{" 00:00:01.686831
INFO: {1899999-01-01,1899999-02-02} "[" 00:00:02.01972
INFO: {1899999-01-01,1899999-02-02} "{" 00:00:01.698365
INFO: {1899999-01-01,1899999-02-02} "[" 00:00:02.008609
INFO: {1899999-01-01,1899999-02-02} "{" 00:00:01.698494
INFO: {1899999-01-01,1899999-02-02} "[" 00:00:01.987951
INFO: {1899999-01-01,1899999-02-02} "{" 00:00:01.698711
INFO: {1899999-01-01,1899999-02-02} "[" 00:00:01.977347
INFO: {1899999-01-01,1899999-02-02} "{" 00:00:01.707921
INFO: {1899999-01-01,1899999-02-02} "[" 00:00:01.945438
INFO: {1899999-01-01,1899999-02-02} "{" 00:00:01.663771
INFO: {1899999-01-01,1899999-02-02} "[" 00:00:02.079186
INFO: {1899999-01-01,1899999-02-02} "{" 00:00:01.752366
DO
Time: 37178.056 ms
Implicitly docs suggest the"curly" way to introduce arrays in the first line:
https://www.postgresql.org/docs/current/static/arrays.html#ARRAYS-INPUT
To write an array value as a literal constant, enclose the element
values within curly braces and separate them by commas.
And later:
https://www.postgresql.org/docs/current/static/sql-expressions.html#SQL-SYNTAX-ARRAY-CONSTRUCTORS
An array constructor is an expression that builds an array value using
values for its member elements.
So you can expect building the curly values from array construct to take additional tick. But surely I'm just speculating here. The answer was meant only to measure linear impact of both ways mixed close in time on no load PC...
Also IN (scalar list) is rewritten to = ANY(array) construct in "curly" format:
so=# explain analyse select * from pg_database where datname in ('t','so');
QUERY PLAN
-------------------------------------------------------------------------------------------------------
Seq Scan on pg_database (cost=0.00..1.02 rows=2 width=254) (actual time=0.105..0.109 rows=2 loops=1)
Filter: (datname = ANY ('{t,so}'::name[]))
I'm not saying it's an implication to do same, but it looks internally chosen way over array[ construct, so might be a hint
'{1,2}::int[]'orarray[1,2]and why?array[is slightly slower - you can try 10K times - if rate remains, I think you can expect its not just a measurement error.