English 中文(简体)
B. 业绩考评
原标题:Performance consideration, please which option is better
  • 时间:2011-11-04 10:01:31
  •  标签:
  • mysql

哪些是较好的——利用甚高的聚合功能COUNT来回选定的发生率或人工计数,并在插入作业期间将计数纳入外地? 考虑到排雷中心的职能是搜查桌子或指数,并在人工计算时将结果分类,我只是找回外地。

最佳回答

如果你手工操作,

  • You do extra work that is not required
  • You ve to remember to do it for each insert and delete operation
  • You slow down because of extra operations
  • You will have inconsistencies when the table is manipulated directly
  • In MyISAM table the count is already retrieved as a field by MySQL
  • In InnoDB it s a little slower, but subsequent calls are cached, so only the first one will be slow

努力使房舍管理事务比房舍管理司的工作做得更好,这不是一个好的想法。 房舍管理处体现了多年的经验和选择。

问题回答

IMO you should always use MySQL internal functions to get results/data from your database.
But it depends also on what you re counting, which data you re retrieving, which operations you need to perform and so on.
Generally, if you can, use MySQL functions: they are fast and reliable!!

我认为,在人工计算时,你必须明确(标准代码),而如果你使用Mysql查询,则由Mysql服务器管理。 在另一起案件中,如果其网络应用程序或你正在建造的东西,则会增加额外的间接费用。 我认为, for计会是明智的!





相关问题
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 ...

热门标签