Sackgesicht VIP
Total posts: 1,636
04 Aug 2013 02:10

We don't use the hide, unpublish and archive function for records.

The record count query depends on some section parameters like "Who can see future articles" or "Who can see expired articles".

SELECT COUNT(*)

  FROM hsb0a_js_res_record AS r

  WHERE r.section_id = 2 

  AND r.ctime < '2013-08-04 06:39:21' 

  AND (r.extime = '0000-00-00 00:00:00' OR r.extime > '2013-08-04 06:39:21') 

  AND r.archive = 0 

  AND r.published = 1

  AND r.hidden = 0

Some additional parameters would allow users to set a faster environment based on their requirements. In our example we would exclude publish, hidden and archive from the query and set future articles and expired articles to public.

This should leave a query like:

SELECT COUNT(*)

  FROM hsb0a_js_res_record AS r

  WHERE r.section_id = 2 

The default query now is 211ms.

But with the new setting, it could be 17ms ...

Last Modified: 02 Mar 2014


Sergey
Total posts: 13,748
04 Aug 2013 23:09

What if you only takje out time and archive?

Powered by Cobalt