SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

mkhenrik
Starting Member

Sweden
2 Posts

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

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.id, a.*, CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug, CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id 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 cc.id = a.catid INNER JOIN jos_sections AS d ON d.id = 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?

webfred
Flowing Fount of Yak Knowledge

Germany
8760 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

mkhenrik
Starting Member

Sweden
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  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000