A
A
askar982021-04-20 13:20:06
PostgreSQL
askar98, 2021-04-20 13:20:06

How can I speed up the search in the Spring Data, Postgres database?

Hello! Now getting 5,10,100 pieces of data out of 1000000 takes about ~10sec. How can you speed up the search? What I did:
1. Added indexes
2. Made all OneToMany links lazy
3. I use Pagable (I read about Slice), but I need to show the number of elements.
Basically all ManyToOne relationships, will lazy help with unnecessary fields to show? And how to make manyToOne Lazy?
Thank you all in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-04-20
@askar98

  1. Run the program under the profiler and analyze its output
  2. Get SQL query and parse its execution plan
  3. Identify bottlenecks and eliminate
  4. PROFIT

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question