Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgresql query in 10 seconds

Tags:

postgresql

Is there a way to create a query that will run for exactly ten seconds ? I don't need real data just a way to run a query for a long time so I can test how the system works in that time.

I would prefer not to create a huge table and make a simple select just for this. Any tricks?

like image 711
johnlemon Avatar asked Dec 29 '22 02:12

johnlemon


1 Answers

pg_sleep:

SELECT pg_sleep(10);

But that will not generate any load on the system if that's your real goal.

like image 190
Milen A. Radev Avatar answered Jan 13 '23 13:01

Milen A. Radev