Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Data Corruption Issues
 Queries taking very long time
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

2 Posts

Posted - 09/10/2013 :  06:26:57  Show Profile  Reply with Quote

We have suddenly noticed that some of our queries are taking over one minute to load.

We are running a slightly old version of the CMS Joomla, but it just stopped working a few months ago.

The worst query is this;

SELECT, a.*, CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":",, a.alias) ELSE END as slug, CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":",, cc.alias) ELSE END as
catslug, a.attribs, a.title, a.introtext as introtext, a.sectionid, a.catid, a.created as created, a.images
FROM jos_content AS a INNER JOIN jos_categories AS cc ON = a.catid INNER JOIN jos_sections AS d ON = a.sectionid
WHERE (a.state = '1') AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2013-09-09 17:35:10') AND (a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2013-09-09 17:35:10')
AND (d.published = '1') AND (cc.published = '1') AND (a.sectionid IN (6, 7, 40, 59, 50, 60, 28, 57, 24, 55, 32, 56, 36, 58)) AND (a.catid IN (111, 121, 135, 113, 115, 122, 123, 132, 110, 112,
114, 118, 68, 69, 120, 67, 86, 170, 173, 171, 202, 157, 158, 154, 152, 153, 161, 162, 167, 165, 166)) AND a.access <= '0'
ORDER BY a.created DESC
LIMIT 5, 3

It shouldn´t be taking forever, right?

We have quite a large amount of sections and categories and about 2000 articles that it seeks through.

Can any of you se anything wrong with the query above?
Or does anyone know what could possibly be causing the problem so sudden?

Flowing Fount of Yak Knowledge

8781 Posts

Posted - 09/10/2013 :  06:39:05  Show Profile  Visit webfred's Homepage  Reply with Quote
We are on MS SQL Server only here. Your code looks like MySQL. So maybe our hints wouldn't work for you.
Better try to ask in a MySQL forum

Too old to Rock'n'Roll too young to die.
Go to Top of Page

Starting Member

2 Posts

Posted - 09/10/2013 :  06:50:16  Show Profile  Reply with Quote
Oh, sorry :) Thanks
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2019 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000