I have a fresh Joomla 3.0 install that is running on MySQL and I'm using Workbench. I keep on running into very, very slow queries. However, it seems to be very few, specific queries. Something like
我有一个在MySQL上运行的新的Joomla 3.0安装,我正在使用Workbench。我一直在遇到非常非常慢的查询。但是,它似乎很少,具体的查询。就像是
SELECT * FROM joom_users
runs very, very slow and often loses the connection. But UPDATE and INSERT work just fine into this table. Ive even imported a CSV file and it was blazing fast. I've already run
运行非常非常慢并且经常失去连接。但是UPDATE和INSERT在这个表中运行得很好。我甚至导入了一个CSV文件,速度非常快。我已经跑了
EXPLAIN SELECT * FROM joom_users
There wasn't anything obviously wrong with the table. All the indexes are there and the table itself is pretty small (only about 300 rows). I've considered that the wildcard may be throwing it off, so I have replaced the wildcard with fields and I have tried querying from other tables with 2 fields (and, in some cases, with no rows) and that ALSO runs slow.
桌子上没有任何明显的错误。所有索引都在那里,表本身很小(只有大约300行)。我认为通配符可能会将其丢弃,所以我已经用字段替换了通配符,我尝试从其他表中查询2个字段(在某些情况下,没有行),并且ALSO运行缓慢。
Also, requests to ALTER the tables are also running slow. Finally, I've also tried multiple machines with Workbench (one Win7, the other OSX) and they both run slowly, so Ive eliminated any local issues that could be causing this.
此外,ALTER表的请求也运行缓慢。最后,我还尝试使用Workbench(一个Win7,另一个OSX)的多台机器,它们都运行缓慢,因此我已经消除了可能导致此问题的任何本地问题。
I'm perplexed by this. Help!
我为此感到困惑。救命!
1 个解决方案
#1
0
There's nothing implicitly wrong with the example query you've given. Theres no indexes it could use, but unless its a really wide table, I would expect it to be very fast.
您给出的示例查询没有任何隐含的错误。没有它可以使用的索引,但除非它是一个非常宽的表,我希望它非常快。
In a shared server environment, you have no idea how many other databases are being hosted or how heavily they are being used. If you can migrate to a local database you'll be able to see if performance improves.
在共享服务器环境中,您不知道托管了多少其他数据库或者它们的使用程度。如果您可以迁移到本地数据库,您将能够看到性能是否有所提高。
If you have 300 active users of your installation, there could be a lot of lock contention, especially on MyISAM which uses full table locks. For example, it looks like the Joomla users table has a lastVisitDate
, which, if it is being updated on every page load by a logged in user, could definitely cause locking problems.
如果您的安装有300个活动用户,则可能存在大量锁争用,尤其是在使用完整表锁的MyISAM上。例如,看起来Joomla users表有一个lastVisitDate,如果在登录用户的每个页面加载时更新它,肯定会导致锁定问题。
#1
0
There's nothing implicitly wrong with the example query you've given. Theres no indexes it could use, but unless its a really wide table, I would expect it to be very fast.
您给出的示例查询没有任何隐含的错误。没有它可以使用的索引,但除非它是一个非常宽的表,我希望它非常快。
In a shared server environment, you have no idea how many other databases are being hosted or how heavily they are being used. If you can migrate to a local database you'll be able to see if performance improves.
在共享服务器环境中,您不知道托管了多少其他数据库或者它们的使用程度。如果您可以迁移到本地数据库,您将能够看到性能是否有所提高。
If you have 300 active users of your installation, there could be a lot of lock contention, especially on MyISAM which uses full table locks. For example, it looks like the Joomla users table has a lastVisitDate
, which, if it is being updated on every page load by a logged in user, could definitely cause locking problems.
如果您的安装有300个活动用户,则可能存在大量锁争用,尤其是在使用完整表锁的MyISAM上。例如,看起来Joomla users表有一个lastVisitDate,如果在登录用户的每个页面加载时更新它,肯定会导致锁定问题。