V
V
val182019-05-31 11:35:36
SQL
val18, 2019-05-31 11:35:36

What select to write so that the database hangs?

What sql query with select to write to freeze the database? For example.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
TheRonCronix, 2019-05-31
@TheRonCronix

DBMS are designed not to depend on the client application. In most cases, if a connection pool is not used, then a separate process is created for each client. You can easily hang your own client process, but not someone else's. However, you can try to slow down the DBMS by affecting shared resources, for example, by evicting parsed queries from the cache by generating many different queries. Not sure if it will work. Or block access to a table or procedure by recompiling it. For the DBMS to really freeze, this requires a bug in the DBMS. But such situations are very individual. In my practice, there was only one such case, when the request dropped the entire DBMS.
I did not deal with the topic of attacks on the DBMS, but the question was asked interesting.

L
Lazy @BojackHorseman, 2019-05-31
SQL

3 tables on 1M records, by indexes on long string fields. execute many competing requests at the same time.

K
kova1ev, 2019-05-31
@kova1ev

you can try to take the largest table and like this:
(the more, the slower it will be)
upd: now I tried in postgre on localhost, a table with a thousand and a few records, query: I burned out 16 gigs of RAM and everything fell

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question