mysql不同服务器查询_mysql解释不同服务器上的不同结果,同一查询,同一个数据库...

经过大量的工作,我终于得到了一个相当复杂的查询,非常流畅地工作,并很快返回结果.

它在开发和测试方面运行良好,但现在测试速度已大大减慢.

解释查询在开发上需要0.06秒并且在测试中大致相同,现在测试时间为7秒.

解释略有不同,我不知道为什么会这样

来自开发者的解释

-+---------+------------------------------+------+------------------------------

---+

| id | select_type | table | type | possible_keys | key

| key_len | ref | rows | Extra

|

+----+-------------+------------+--------+-------------------------+------------

-+---------+------------------------------+------+------------------------------

---+

| 1 | PRIMARY | | ALL | NULL | NULL

| NULL | NULL | 5 |

|

| 1 | PRIMARY | tickets | ref | biddate_idx | biddate_idx

| 7 | showsdate.bid,showsdate.date | 78 |

|

| 2 | DERIVED | shows | ALL | biddate_idx,latlong_idx | NULL

| NULL | NULL | 3089 | Using temporary; Using fileso

rt |

| 2 | DERIVED | genres | ref | bandid_idx | bandid_idx

| 4 | activehw.shows.bid | 2 | Using index

|

| 2 | DERIVED | artists | eq_ref | bid_idx | bid_idx

| 4 | activehw.genres.bid | 1 | Using where

|

+----+-------------+------------+--------+-------------------------+------------

并在测试中

| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |

+----+-------------+------------+--------+-------------------------+-------------+---------+------------------------------+--------+----------------------------------------------+

| 1 | PRIMARY | | ALL | NULL | NULL | NULL | NULL | 5 | |

| 1 | PRIMARY | tickets | ref | biddate_idx | biddate_idx | 7 | showsdate.bid,showsdate.date | 78 | |

| 2 | DERIVED | genres | index | bandid_idx | bandid_idx | 139 | NULL | 531281 | Using index; Using temporary; Using filesort |

| 2 | DERIVED | artists | eq_ref | bid_idx | bid_idx | 4 | activeHW.genres.bid | 1 | |

| 2 | DERIVED | shows | eq_ref | biddate_idx,latlong_idx | biddate_idx | 7 | activeHW.artists.bid | 1 | Using where |

+----+-------------+------------+--------+-------------------------+-------------+---------+------------------------------+--------+----------------------------------------------+

5 rows in set (6.99 sec)

即使查询完全相同,表的顺序也不同.

这会导致经济放缓吗?如果是的话,我该如何解决?

开发是windows,测试是centOs.

两个都运行相同版本的mysql 5.0,就像我说的,测试运行完美,我没有对数据库进行任何结构更改.

我运行mysqlcheck,所有表都回来了.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值