A
A
arionaRu2020-08-28 21:05:40
PostgreSQL
arionaRu, 2020-08-28 21:05:40

Searching records in postgres database?

Suppose we have a list of a million id. It is necessary to make a selection from the base of the record whose id is in this list. What are the effective solutions? Beyond the obviousfindByIdIn(List<String> id)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Roo, 2020-08-28
@xez

1. Make another table with a million id
2. Make join and select.

A
Alexander Filippenko, 2020-09-02
@alexfilus

Create somewhere separately an ARRAY type field with these IDs, and substitute it in the query
... where id = any(array_field)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question