PostgreSQL查询在10秒内 [英] Postgresql query in 10 seconds

查看:257
本文介绍了PostgreSQL查询在10秒内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以创建将运行十秒钟的查询?我不需要真实数据只是长时间运行查询的一种方式,因此我可以测试该系统在这段时间内的工作方式。

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?

推荐答案

pg_sleep

SELECT pg_sleep(10);

但是,如果这是您的真正目标,则不会对系统产生任何负载。

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

这篇关于PostgreSQL查询在10秒内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆