I'm fairly new to PostgreSQL and have a question about query performance.
I get a set of values by parsing a file and want to count how many of them already exist in a specific column in my database (PostgreSQL). Currently I do this by parsing the whole file, storing its values in an array and then executing an IN query as follows:
SELECT COUNT(DISTINCT(id)) FROM "account" WHERE name IN ('name1', 'name2', 'name3');
The column "name" which is being queried has a unique index on it.
I am wondering if this approach would be optimal if the array grows larger (20.000+ values) and/or I execute the query on a table with 40.000+ existing rows. Or is there a better approach?