PostgreSQL (big data): search by tags and order by timestamp
There are two approaches:


create an index on the array:

CREATE INDEX ON items USING gin (tags);


That allows the database to quickly find the matching rows, but then it has to perform a top-n sort.
create a B-tree index on created_at:

CREATE INDEX ON items (created_at);


That will allow the database to avoid the sort, but it has to scan and discard the rows that don't match the condition.


Unfortunately, the two strategies are mutually exclusive, and which is best depends on the data. You'll have to experiment.