I get more than 1000 select queries of the form. Each select query corresponds to an id.

SELECT * FROM directories_data WHERE id = ANY (ARRAY[213,2412]); 

Decided to pack them in 1 request to increase productivity.

  SELECT * FROM directories_data WHERE id = ANY (ARRAY[213,2412]); SELECT * FROM directories_data WHERE id = ANY (ARRAY[213,2412]); SELECT * FROM directories_data WHERE id = ANY (ARRAY[213,2412]); 

Questions:

  1. Do I need to set BEGIN COMMIT so that the order of requests is the same?
  2. Is it possible to make 1 instead of multiple SELECT queries for the sake of performance savings, or will it not work?

    0