N
N
Nastya19202021-10-20 22:10:31
PostgreSQL
Nastya1920, 2021-10-20 22:10:31

How to process a large amount of data?

There are a million accounts in the database. It is necessary to periodically launch the update process: for all accounts with the x==a parameter, change this parameter to x==b.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Armenian Radio, 2021-10-20
@gbg

A wise pattern is stupidly not to drive data from the database back and forth. So run the update right in the database.
Don't look at trendy boys in hoodies who cancel stored procedures and triggers and advise you to turn the RDBMS into a dump of tables (and remove foreingn keys, because they get in the way).

R
Ronald McDonald, 2021-10-20
@Zoominger

And why pull something through Java? It is possible to schedule directly in the DBMS. An example for MS SQL to make it clear: https://www.osp.ru/winitpro/2017/01/13051261

K
Konstantin Tsvetkov, 2021-10-20
@tsklab

Install pgAgent. Guide .
Create a task. Guide .
With a request (from Aleksey )UPDATE accounts SET x=b WHERE x=a;

Y
Yerlan Ibraev, 2021-10-21
@mad_nazgul

Only pure SQL! Only hardcore!
And so use JDBC or Spring JdbcTemplate you will be happy. :-)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question