English 中文(简体)
一种无效的行踪是否比有效慢? (MySQL)
原标题:Is an invalid DB query slower than a valid one? (MySQL)

This is kind of a weird question but...
If I run this query in MySQL:

选择以下表格:

显然无效的是,与提出有效询问相比,我是否得到某种时间处罚(除 throw、伐木、某种)。

我要问的理由是,我刚刚发现一把一把.(不是由我写的)正在向非行提出这种特别的疑问,我不禁要问,这种固定办法是否有助于解决我们在同一个服务器上遇到的一些令人厌恶的业绩问题。

我的推理是以经常语言的“例外”为基础,尽管我完全理解,这里绝对没有平行,而且没有什么东西可以做。 也许有些伐木涉及,或者有些伐木使伐木速度放慢?

任何想法?

<><>UPDATE: 我应该指出这一点。 页: 1 但我们再次在服务器上出现一些令人望而却步的绩效问题,我希望看到,我能否期望这大有助益。 将每秒15次的定期查询传送给配备这种负荷的服务器,肯定不会是大的帮助(不过,仍有一刀切。 然而,如果无效的质询必须做一些需要时间的事情,则可能是......。

Thanks! Daniel

最佳回答

仅把这搁置一边,看着执行时间,其价值有效和无效。 无可通知的执行时间差异。 我仍然主张根据对数据库的突然访问确定。

问题回答

极具讽刺意味的是,很难进入数据库,因此,数据库应比需要做的工作快得多(但无论如何都不会返回)。

尽管如此,选择者有时会发现 st子,这样,如果你说WHERE 1=0的话,就会在不实际触及表格的情况下抛弃一个空洞。

由于服务器不得不将盘问和结果退回给客户(数据集或故障状况),因此,这种定购率比有效盘点要慢。

当然,如果申请不需要首先发出询问(即,它不仅仅是一个编码错误,因为should/em>是一种条件,但可以排除)那么,你当然应该能够避免一点工作,根本就不公布。





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...