关于SQL查询,什么被认为较慢? [英] What is considered slow with respect to SQL queries?

查看:90
本文介绍了关于SQL查询,什么被认为较慢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用Node.js编写的服务器端代码,可在一个请求中进行6个SQL查询.查询主要由带有两个INNER JOINOUTER JOINSELECT语句组成.

I have a server-side code written in Node.js that makes 6 SQL queries in one request. The queries consist of mostly SELECT statements with a couple of INNER JOIN and OUTER JOIN.

当我直接在命令行中运行它们时,它们大约需要4毫秒.

They take about 4ms when I run them directly in command-line.

我很好奇它们何时会变慢,我可能不得不开始计算结果.来自前端世界的4ms似乎非常快!

I am curious at what point they would be considered slow and I'll have to maybe start memcaching the results. Coming from front-end world, 4ms seems extremely fast!

推荐答案

关于SQL查询,什么被认为是缓慢的?

What is considered slow with respect to SQL queries?

用户抱怨的任何事情.

Anything the user complains about.

当然,这并不总是理性的,但它是唯一有意义的答案.这个问题非常依赖于上下文. OLTP系统将具有与OLAP不同的特性.此外,对于单个数据库查找而言,最快的速度可能会慢到6.

And of course that is not always rational but it is the only meaningful anwer. The quesiton is so dependant on context; a OLTP system will have different characteristics from an OLAP one. Also, what might be fast for a single DB lookup may be slow with 6.

如果成品使用缓慢,请担心它,否则请着重于质量的其他方面.当然,有些东西可以帮助您提高性能,但是请不要在问题出现之前就查找问题.

If the finished product is slow to use worry about it, otherwise focus on other aspects of quality. Of course is something presents itwelf to enable you to improve performance do so but don't look for problems before they exist.

这篇关于关于SQL查询,什么被认为较慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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