What is a fast of checking which ids exists in postgreSQL table
I wrote the following function but it comes very slow when x is bigger than 500 000
x