Browse
 
Tools Add
Rss Categories
-->

PHP Application Clustering with Mod Proxy

Reference Number: AA-04691 Created: 2013-01-03 17:09 Last Updated: 2013-01-03 17:09 0 Rating/ Voters

What is Clustering

Clustering is the technique of linking many computers together to act like a single computer. Generally, a PHP cluster is composed of multiple webservers running PHP individually which then is load-balanced either by a hardware or a software based load balancer. Common examples of hardware load balancer could be F5 BigIP, Nortel’s (Alteon), AceDirector AD3 etc and software load balancer are Apache httpd server, Nginx etc.

Requirements for PHP Cluster

To set a PHP cluster, following are required:

  1. Three Linux servers – One server as a load balancer and other two as the PHP application nodes. They can run any Linux OS. We would be using Debian 6 and CentOS 64bits edition in these three environments in two separate examples. We will refer to load balancer node as LB and the application nodes as s1 and s2 respectively from now.
  2. Apache httpd v2.2 with mod_rewrite, mod_proxy – Apache httpd should be installed on all the three servers with the support of mod_rewrite, mod_proxy, mod_proxy_http modules.
  3. PHP – PHP should be installed on the two Linux servers acting as application nodes (s1 and s2). You can refer my earlier post – The Perfect LAMP Stack to setup the application nodes. We will use PHP only for testing our cluster setup.

Theory of Operation

The setup will make load balancer (LB) to act as the reverse proxy in front of the application nodes (A1 and A2). When a client will send the request to our server, the LB will pass it to the application nodes based on a predefined method as set by us in the Apache httpd configuration.

How to cluster with PHP Debian

After installing the above mentioned applications, to setup the PHP clusters, now we only require to create Apache httpd configuration on LB server to make it act like a reverse proxy.

Open the VirtualHost file default in /etc/apache2/sites-available

  • ServerName will have your URL or ip for the load balancer (LB) server.
ServerName lb.example.com
  • DocumentRoot will be your path to publicly available documents.
 DocumentRoot /var/www/
  • ProxyRequests off will prevent your load balancer to act as a forward proxy server.

Note: When you compile mod_proxy with Apache httpd, it can allow you to use the server to act either as a forward proxy or reverse proxy server. The above setting is just used for prevention.

ProxyRequests Off
  • <Proxy> directive will allow you to enforce rules upon the proxied content. Here you can set what constraint you want to apply on the proxied content for e.g. you can only allow few ip range to access the load balancer. In our case we are going to allow from all as it is the load balancer in front of public.
        <Proxy *>
                Order deny,allow
                Allow from all
        </Proxy>
  • ProxyPass directive will configure the url mapping from the reverse proxy server to the application nodes. You can also configure which url should be translated and sent to backend and which should not. In the following settings, we have configured that when the /balancer-manager is requested, it should not be sent to the backend whereas all other requests should be forwarded there. The balancer://mycluster/ defines our clusters where we will transmit the load and which we will be configuring in next step. The stickysession directive is used here for the sessions which I will explain later in some other post. nofailover directive is related to sessions.
                ProxyPass /balancer-manager !
                ProxyPass / balancer://mycluster/ stickysession=PHPSESSID $
                ProxyPassReverse / http://s1.example.com/
                ProxyPassReverse / http://s2.example.com/
  • Once again, we would be defining the <Proxy> directive, but this time we will be using it to enhouse our balancer configurations. The BalancerMember directive is used to add the add the application nodes to the cluster and as of our configuration, we are going to add our two application nodes a1 and a2. The route directive value will be appended to the session id. The ProxySet directive is used to define the additional balancer configuration parameters. In our case, we are going to define the load balancing method which we are going to use in the lbmethod parameter and that is byrequests. The other available methods are bytraffic and bybusyness. To know more about load balancing methods, please refer to http://httpd.apache.org/docs/2.1/mod/mod_proxy_balancer.html
        <Proxy balancer://mycluster>
                BalancerMember http://s1.example.com  route=s1
                BalancerMember http://s2.example.com  route=s2

                ProxySet lbmethod=byrequests
        </Proxy>
  • Next, we have defined the settings of the balancer-manager which allows us to view the dynamic update of balancer members i.e. the application nodes. You would be requiring to enable mod_status module in Apache httpd to use the balancer-manager
        <Location /balancer-manager>
                SetHandler balancer-manager
                Order deny,allow
                Allow from all
        </Location>

Note: We have explained the very basic settings here to setup the Apache httpd to act as a reverse proxy load balancer. You can fine tune the settings according to your needs and to know more about the available options, please refer to http://httpd.apache.org/docs/current/mod/mod_proxy.html

  • The complete settings which we have explained earlier can be seen below:
<VirtualHost *:80>
        ServerName lb.example.com
        DocumentRoot /var/www/
        ProxyRequests Off

        <Proxy *>
                Order deny,allow
                Allow from all
        </Proxy>

                ProxyPass /balancer-manager !
                ProxyPass / balancer://mycluster/ stickysession=PHPSESSID $
                ProxyPassReverse / http://s1.example.com/
                ProxyPassReverse / http://s2.example.com/
        <Proxy balancer://mycluster>
                BalancerMember http://s1.example.com  route=s1
                BalancerMember http://s2.example.com  route=s2
                ProxySet lbmethod=byrequests
        </Proxy>

        <Location /balancer-manager>
                SetHandler balancer-manager
                Order deny,allow
                Allow from all
        </Location>
</VirtualHost>
  • Save the default VirtualHost after making the above settings and restart the server. That will complete our task of creating Apache httpd as reverse proxy load balancer server.

Testing PHP Cluster

Now, to test your PHP cluster setup, create a file test.php in your application nodes s1 and s2. The source code for the file would be very simple and as below: For s1 node,

<?php

echo 'Hi, I am from Server 1';

?>

For s2 node,

<?php

echo 'Hi, I am from Server 2';

?>
Rss Comments
  • There are no comments for this article.
Info Add Comment
Nickname: Your Email: Subject: Comment:
0.0043351650238037
SELECT `sys_settings`.`var_name`, `sys_settings`.`var_value` FROM `sys_settings`
0.0005800724029541
SELECT `languages`.`lang_id` FROM `languages` WHERE (lang = 'def')
0.0079188346862793
SELECT `languages_vars`.`language_var`, `languages_vars`.`value` FROM `languages_vars` WHERE (lang_id = 1) AND (type != 'notification')
0.0082640647888184
SELECT `languages_vars`.`language_var`, `languages_vars`.`value` FROM `languages_vars` WHERE (lang_id = 1) AND (type != 'notification')
0.00080990791320801
SELECT `sys_settings`.`var_value` FROM `sys_settings` WHERE (var_name = 'session_life_time_unlimited')
0.00090599060058594
SELECT `ac`.`auto_relate`, `ac`.`max_staff_users`, `ac`.`max_client_users`, `ac`.`name`, (SELECT COUNT(*) FROM `users` WHERE (account_id = 2) AND (ldap_user = 'Y')) AS `ldap_users_num` FROM `accounts` AS `ac` WHERE (ac.account_id = 2)
0.00063800811767578
SELECT COUNT(us.user_id) FROM `users` AS `us` WHERE (type   = 'staff') AND (active = 'Y') AND (account_id = 2) AND ((SELECT COUNT(*) FROM `users_groups` AS `ug` WHERE (ug.user_id = us.user_id)) > 0) AND (login != 'sales@web-site-scripts.com')
0.0018291473388672
SELECT COUNT(us.user_id) FROM `users` AS `us` WHERE (type   = 'client') AND (active = 'Y') AND (account_id = 2) AND ((SELECT COUNT(*) FROM `users_groups` AS `ug` WHERE (ug.user_id = us.user_id)) > 0) AND (login != 'sales@web-site-scripts.com')
0.00073790550231934
SELECT COUNT(us.user_id) FROM `users` AS `us` WHERE (account_id = 2) AND ((SELECT COUNT(*) FROM `users_groups` AS `ug` WHERE (ug.user_id = us.user_id)) = 0) AND (login != 'sales@web-site-scripts.com')
0.00062799453735352
SELECT COUNT(*) AS `count` FROM `accounts` WHERE (LOWER(name) != 'preview')
0.00056099891662598
SELECT `accounts`.`name` FROM `accounts` WHERE (LOWER(name) != 'preview') ORDER BY `account_id` ASC LIMIT 1
0.001072883605957
SELECT `view_manage`.`view_id`, `view_manage`.`name` FROM `view_manage` WHERE (type       = 'Hosted') AND (account_id = 2)
0.00092220306396484
SELECT `vm`.`view_id` AS `id`, `vm`.`name`, `vm`.`type`, `vm`.`hash`, `vm`.`settings` AS `tabs`, `vm`.`style_id` AS `styles`, `vm`.`gmt`, `vm`.`time_format`, `vm`.`date_format`, `vm`.`lang_id`, `vm`.`status`, `vm`.`access_mode`, `vm`.`voting_id` AS `voting`, `g`.`offset` AS `gmt_offset` FROM `view_manage` AS `vm`
 LEFT JOIN `gmt` AS `g` ON g.gmt_id = vm.gmt WHERE (view_id = 2)
0.0034301280975342
SELECT `votings`.`voting_id` AS `value`, `votings`.`voting_name` AS `text` FROM `votings` WHERE (account_id = 2) OR (system = 'Y') ORDER BY `voting_name` ASC
0.0034129619598389
SELECT `tpl`.`theme_id`, `tpl`.`theme_name`, `tpl`.`based_on`, `tpl`.`system`, CASE WHEN ((vm.style_id = tpl.copy_of_theme OR vm.style_id = tpl.theme_id) AND vm.account_id = 2) THEN 'Y' ELSE  'N' END AS `current` FROM `tpl_themes` AS `tpl`
 LEFT JOIN `view_manage` AS `vm` ON (vm.style_id = tpl.copy_of_theme OR vm.style_id = tpl.theme_id) AND vm.type = 'Hosted'  AND vm.account_id = 2 WHERE (tpl.account_id = 1 AND tpl.copy = 'N' AND tpl.system = 'Y') OR (tpl.account_id = 2 AND copy = 'N' AND tpl.system = 'N') ORDER BY `theme_name` ASC
0.00056600570678711
SELECT `votings`.* FROM `votings` WHERE (voting_id = 1)
0.0005791187286377
SELECT `voting_items`.`item_title` AS `title`, `voting_items`.`value` FROM `voting_items` WHERE (voting_id = 1) ORDER BY `value` DESC
0.0026810169219971
SELECT `view_styles`.* FROM `view_styles` WHERE (style_id = 4)
0.0019588470458984
SELECT `view_elements_styles`.`element_name` AS `name`, `view_elements_styles`.`element_type` AS `style` FROM `view_elements_styles` WHERE (style_id = 4) ORDER BY `element_name` ASC
0.00058913230895996
SELECT `languages`.`name` AS `text`, `languages`.`lang_id` AS `value` FROM `languages` WHERE (status = 'on') AND (lang != 'def') ORDER BY `lang_id` ASC
0.00088620185852051
SELECT `gmt`.* FROM `gmt` ORDER BY `offset` ASC
0.0005638599395752
SELECT `view_manage`.`view_id` AS `id`, `view_manage`.`hash`, `view_manage`.`status`, `view_manage`.`lang_id`, `view_manage`.`name` FROM `view_manage` WHERE (account_id = 2) AND (type = 'HOSTED') LIMIT 1
0.00099086761474609
SELECT `view_manage`.`view_id`, `view_manage`.`name` FROM `view_manage` WHERE (type       = 'Hosted') AND (account_id = 2)
0.00074100494384766
SELECT `view_manage`.`settings` FROM `view_manage` WHERE (view_id = 2)
0.00047588348388672
UPDATE `view_manage` SET `views_num` = views_num + 1, `last_view_date` = ? WHERE (view_id = 2)
0.00052690505981445
SELECT `faq_articles`.`faq_id` FROM `faq_articles` WHERE (code = 'AA-04691') AND (account_id = 2) AND (status = 'moderated')
0.00037384033203125
DROP TABLE IF EXISTS `tmp_visible_articles_20101`;
0.00033879280090332
DROP TABLE IF EXISTS `tmp_visible_articles_20101`;
0.00082802772521973
CREATE TEMPORARY TABLE `tmp_visible_articles_20101` (`faq_id` int PRIMARY KEY) ENGINE=MEMORY
0.10031580924988
INSERT INTO `tmp_visible_articles_20101` SELECT `faq`.`faq_id` AS `id` FROM `faq_articles` AS `faq` USE INDEX (`PRIMARY`) WHERE (account_id = 2) AND (freeAccess = 'Y') AND (draft = 'N') AND (status = 'moderated') AND ( `public` = 'Y' AND
                                ((public_start_date <= '2013-05-24 00:30:02' OR public_start_date IS NULL)
                                    AND
                                  (public_end_date IS NULL OR public_end_date >= '2013-05-24 00:30:02')
                                ))
0.0016119480133057
SELECT `tmp_visible_articles_20101`.`faq_id` FROM `tmp_visible_articles_20101`
0.044271945953369
SELECT `far`.`faq_id` AS `faqId`, `far`.`featured`, `far`.`question`, `far`.`views`, `far`.`rating`, `far`.`faq_date`, `far`.`status_change_date` FROM `faq_articles` AS `far`
 INNER JOIN `tmp_visible_articles_20101` AS `tmp` ON far.faq_id = tmp.faq_id WHERE (draft = 'N') AND (far.featured = 'Y') ORDER BY `far`.`status_change_date` DESC, `faqId` DESC LIMIT 10
0.0018610954284668
SELECT `fa`.`faq_id` AS `faqId`, `fa`.`question`, `fa`.`code`, `fa`.`views`, `fa`.`rating`, `fa`.`featured`, `fa`.`answer`, CASE
                                            WHEN (`public` = 'Y' AND (((public_start_date <= '2013-05-24 00:30:03') OR (public_start_date IS NULL))
                                                    AND (public_end_date IS NULL OR public_end_date >= '2013-05-24 00:30:03')))
                                            THEN 'Y'
                                            ELSE 'N'
                                        END  AS `public`, `fa`.`faq_date` AS `date`, `fa`.`status_change_date` AS `lastEditDate`, `fa`.`public_start_date` AS `publicStartDate` FROM `faq_articles` AS `fa` WHERE (fa.faq_id IN (4584,4814,4815,4816,4596,3565)) AND (fa.status = 'moderated') ORDER BY `fa`.`status_change_date` DESC, `faq_id` DESC
0.00061893463134766
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4584)
0.00059008598327637
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 8)
0.00054121017456055
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 17)
0.00050616264343262
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 8)
0.0005490779876709
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 35)
0.00050806999206543
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 17)
0.00041985511779785
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 37)
0.00047683715820312
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 35)
0.00067901611328125
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 206)
0.00051498413085938
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 200)
0.00048518180847168
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 221)
0.00054717063903809
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 207)
0.00054597854614258
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 354)
0.00057697296142578
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 205)
0.00046801567077637
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 355)
0.00077700614929199
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4814)
0.00060081481933594
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 368)
0.00048995018005371
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4815)
0.0007328987121582
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4816)
0.00058507919311523
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4596)
0.00080609321594238
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 356)
0.00071406364440918
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 34)
0.00047206878662109
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 3565)
0.00067591667175293
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 284)
0.00056695938110352
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 315)
0.00058197975158691
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 215)
0.00067687034606934
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 212)
0.053866863250732
SELECT `far`.`faq_id` AS `faqId`, `far`.`featured`, `far`.`question`, `far`.`views`, `far`.`rating`, `far`.`faq_date`, `far`.`status_change_date` FROM `faq_articles` AS `far`
 INNER JOIN `tmp_visible_articles_20101` AS `tmp` ON far.faq_id = tmp.faq_id WHERE (draft = 'N') ORDER BY `far`.`views` DESC, `faqId` DESC LIMIT 10
0.0042269229888916
SELECT `fa`.`faq_id` AS `faqId`, `fa`.`question`, `fa`.`code`, `fa`.`views`, `fa`.`rating`, `fa`.`featured`, `fa`.`answer`, CASE
                                            WHEN (`public` = 'Y' AND (((public_start_date <= '2013-05-24 00:30:03') OR (public_start_date IS NULL))
                                                    AND (public_end_date IS NULL OR public_end_date >= '2013-05-24 00:30:03')))
                                            THEN 'Y'
                                            ELSE 'N'
                                        END  AS `public`, `fa`.`faq_date` AS `date`, `fa`.`status_change_date` AS `lastEditDate`, `fa`.`public_start_date` AS `publicStartDate` FROM `faq_articles` AS `fa` WHERE (fa.faq_id IN (1064,1094,845,4584,1061,510,4614,842,698,907)) AND (fa.status = 'moderated') ORDER BY `fa`.`views` DESC, `faq_id` DESC
0.00054001808166504
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 1064)
0.00045394897460938
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 147)
0.00060796737670898
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 357)
0.00048589706420898
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 1094)
0.00054216384887695
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 845)
0.00064301490783691
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 36)
0.00050902366638184
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 358)
0.00049710273742676
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 1061)
0.00051593780517578
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 510)
0.00067305564880371
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 183)
0.00088810920715332
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 182)
0.00046515464782715
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4614)
0.00053596496582031
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 842)
0.00051498413085938
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 698)
0.00052690505981445
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 19)
0.00053906440734863
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 9)
0.00063586235046387
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 907)
0.00043892860412598
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 142)
0.00045990943908691
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 33)
0.00052595138549805
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 16)
0.049909114837646
SELECT `far`.`faq_id` AS `faqId`, `far`.`featured`, `far`.`question`, `far`.`views`, `far`.`rating`, `far`.`faq_date`, `far`.`status_change_date` FROM `faq_articles` AS `far`
 INNER JOIN `tmp_visible_articles_20101` AS `tmp` ON far.faq_id = tmp.faq_id WHERE (draft = 'N') ORDER BY `far`.`rating` DESC, `faqId` DESC LIMIT 10
0.053175926208496
SELECT `fa`.`faq_id` AS `faqId`, `fa`.`question`, `fa`.`code`, `fa`.`views`, `fa`.`rating`, `fa`.`featured`, `fa`.`answer`, CASE
                                            WHEN (`public` = 'Y' AND (((public_start_date <= '2013-05-24 00:30:03') OR (public_start_date IS NULL))
                                                    AND (public_end_date IS NULL OR public_end_date >= '2013-05-24 00:30:03')))
                                            THEN 'Y'
                                            ELSE 'N'
                                        END  AS `public`, `fa`.`faq_date` AS `date`, `fa`.`status_change_date` AS `lastEditDate`, `fa`.`public_start_date` AS `publicStartDate` FROM `faq_articles` AS `fa` WHERE (fa.faq_id IN (4625,4624,4614,4610,4584,4401,994,644,642,4873)) AND (fa.status = 'moderated') ORDER BY `fa`.`rating` DESC, `faq_id` DESC
0.00068497657775879
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4625)
0.00053620338439941
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4624)
0.00057697296142578
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 18)
0.00056004524230957
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 47)
0.00048303604125977
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 25)
0.00055503845214844
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 11)
0.00044703483581543
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 7)
0.00069808959960938
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 66)
0.00051403045654297
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 24)
0.00057220458984375
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4610)
0.00048017501831055
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4401)
0.00049495697021484
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 994)
0.00044894218444824
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 130)
0.0004279613494873
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 32)
0.00052785873413086
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 644)
0.00064301490783691
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 79)
0.00060009956359863
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 27)
0.00052690505981445
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 12)
0.00044107437133789
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 98)
0.00058698654174805
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 26)
0.00071907043457031
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 642)
0.00059103965759277
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 81)
0.00065803527832031
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4873)
0.00058817863464355
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 247)
0.00077295303344727
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 246)
0.050839185714722
SELECT `far`.`faq_id` AS `faqId`, `far`.`featured`, `far`.`question`, `far`.`views`, `far`.`rating`, `far`.`faq_date`, `far`.`status_change_date` FROM `faq_articles` AS `far`
 INNER JOIN `tmp_visible_articles_20101` AS `tmp` ON far.faq_id = tmp.faq_id WHERE (draft = 'N') ORDER BY `far`.`real_creation_date` DESC, `faqId` DESC LIMIT 10
0.12953019142151
SELECT `fa`.`faq_id` AS `faqId`, `fa`.`question`, `fa`.`code`, `fa`.`views`, `fa`.`rating`, `fa`.`featured`, `fa`.`answer`, CASE
                                            WHEN (`public` = 'Y' AND (((public_start_date <= '2013-05-24 00:30:03') OR (public_start_date IS NULL))
                                                    AND (public_end_date IS NULL OR public_end_date >= '2013-05-24 00:30:03')))
                                            THEN 'Y'
                                            ELSE 'N'
                                        END  AS `public`, `fa`.`faq_date` AS `date`, `fa`.`status_change_date` AS `lastEditDate`, `fa`.`public_start_date` AS `publicStartDate` FROM `faq_articles` AS `fa` WHERE (fa.faq_id IN (4873,4872,4871,4870,4869,4865,4864,4863,4862,4861)) AND (fa.status = 'moderated') ORDER BY `fa`.`real_creation_date` DESC, `faq_id` DESC
0.00086402893066406
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4872)
0.00051999092102051
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4871)
0.00057792663574219
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 371)
0.00070905685424805
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 210)
0.00081396102905273
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4870)
0.00090599060058594
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4869)
0.00053000450134277
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4865)
0.00054192543029785
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 231)
0.00067615509033203
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 209)
0.00060105323791504
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4864)
0.00070595741271973
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4863)
0.00059604644775391
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 312)
0.00051403045654297
SELECT `faq_categories`.`cat_name`, `faq_categories`.`cat_id`, `faq_categories`.`parent_id` FROM `faq_categories` WHERE (cat_id = 310)
0.00068306922912598
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4862)
0.00065398216247559
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4861)
0.0014669895172119
SELECT `far`.`faq_id` AS `faqId`, `far`.`code`, `far`.`email`, `far`.`public` AS `public_`, `far`.`draft`, `far`.`locked`, `far`.`answer`, `far`.`lock_user_id`, `far`.`question`, `far`.`status`, `far`.`featured`, `far`.`freeAccess`, UNIX_TIMESTAMP(far.lock_date) AS `lock_date`, `far`.`author` AS `author_id`, `far`.`editor` AS `editor_id`, `far`.`faq_date` AS `date`, `far`.`rating`, `far`.`views`, `far`.`public_start_date` AS `publicStartDate_`, `far`.`public_end_date` AS `publicEndDate_`, CASE
                                                                WHEN status_change_date IS NULL OR (status_change_date <= '1970-01-01 00:00:00')
                                                                THEN faq_date
                                                                ELSE status_change_date
                                                            END  AS `lastEditDate`, CASE
                                              WHEN (`public` = 'Y' AND (((public_start_date <= '2013-05-24 00:30:03') OR (public_start_date IS NULL))
                                                    AND (public_end_date IS NULL OR public_end_date >= '2013-05-24 00:30:03')))
                                              THEN 'Y'
                                              ELSE 'N'
                                            END  AS `public`, `far`.`meta_keywords`, `far`.`meta_description`, `far`.`KEYWORD_JSGUI`, `far`.`KEYWORD_KMP`, `far`.`KEYWORD_JSGUI_URL`, `far`.`KEYWORD_KMP_URL`, CONCAT_WS(' ', us.fname,us.lname) AS `author_login`, CONCAT_WS(' ', us_e.fname,us_e.lname) AS `editor_login`, CONCAT_WS(' ', us_l.fname,us_l.lname) AS `lock_login`, (SELECT COUNT(*) FROM `faq_attachments` WHERE (faq_id = 4618)) AS `attaches` FROM `faq_articles` AS `far`
 LEFT JOIN `users` AS `us` ON far.author = us.user_id
 LEFT JOIN `users` AS `us_e` ON far.editor = us_e.user_id
 LEFT JOIN `users` AS `us_l` ON far.lock_user_id = us_l.user_id WHERE (far.faq_id = 4618) AND ( (far.`public` = 'Y' AND (((far.public_start_date <= '2013-05-24 00:30:03') OR (far.public_start_date IS NULL)) AND (far.public_end_date IS NULL OR far.public_end_date >= '2013-05-24 00:30:03')))) LIMIT 1
0.00072407722473145
SELECT `v_com`.`faq_vc_id` AS `v_com_id`, `v_com`.`visitor_subject` AS `v_com_subject`, `v_com`.`visitor_comment` AS `v_com_comment`, `v_com`.`visitor_comment_date` AS `v_com_date`, `v_com`.`nickname` AS `v_com_nick`, `v_com`.`email` AS `v_com_email`, `v_com`.`user_ip` AS `v_com_ip`, `u_com`.`faq_uc_id` AS `u_com_id`, `u_com`.`user_subject` AS `u_com_subject`, `u_com`.`user_comment` AS `u_com_comment`, `u_com`.`user_comment_date` AS `u_com_date`, CASE WHEN u_com.faq_uc_id IS NULL THEN 0 ELSE 1 END AS `nouser`, `usr`.`fname`, `usr`.`lname` FROM `faq_visitors_comments` AS `v_com`
 LEFT JOIN `faq_users_comments` AS `u_com` ON v_com.faq_vc_id = u_com.faq_vc_id
 LEFT JOIN `users` AS `usr` ON u_com.author_id = usr.user_id WHERE (v_com.faq_id = 4618) AND (v_com.comment_status != 'delete') AND (v_com.comment_status != 'new') ORDER BY `v_com_date` DESC, `u_com_date` ASC
0.0005180835723877
SELECT `faq_statistics`.`stat_id` AS `id`, `faq_statistics`.`feedback` AS `message`, `faq_statistics`.`stat_date` AS `date`, `faq_statistics`.`email`, `faq_statistics`.`rating` AS `voter` FROM `faq_statistics` WHERE (faq_id = 4618) AND (feedback NOT LIKE '')
0.00081205368041992
SELECT SQL_CALC_FOUND_ROWS `custom_fields`.`cf_id` AS `id`, `custom_fields`.`name`, `custom_fields`.`type`, `custom_fields`.`position`, `custom_fields`.`required`, `custom_fields`.`internal`, `custom_fields`.`hint`, `custom_fields`.`use_hint`, `custom_fields`.`listHeight`, `custom_fields`.`search_back`, `custom_fields`.`search_front`, `custom_fields`.`show_empty`, `custom_fields`.`WYSIWYG`, `custom_fields`.`optionsDelimiter`, `custom_fields`.`format`, `custom_fields`.`isLink` FROM `custom_fields` WHERE (account_id = 2) ORDER BY `position` ASC
0.00061988830566406
SELECT `cfa`.`cf_id`, `cfa`.`cf_o_id`, `cfa`.`value`, `cf`.`name`, `cf`.`optionsDelimiter`, `cf`.`internal`, `cf`.`type`, `cf`.`format`, `cf`.`position`, `cf`.`show_empty`, `cf`.`search_front` FROM `custom_fields_articles` AS `cfa`
 INNER JOIN `custom_fields` AS `cf` ON cf.cf_id = cfa.cf_id WHERE (cfa.faq_id = 4618) ORDER BY `cf_id` ASC
0.00057387351989746
SELECT `fc`.`cat_id`, `fc`.`cat_name`, `fc`.`account_id` FROM `articles_categories` AS `ac`
 LEFT JOIN `faq_categories` AS `fc` ON fc.cat_id = ac.category_id WHERE (ac.faq_id = 4618)
0.00077986717224121
SELECT `fa`.`faq_id` AS `id`, `fa`.`views`, `fa`.`rating`, `fs`.`stat_id` AS `voters`, `fs`.`stat_date` AS `statDate` FROM `faq_articles` AS `fa`
 LEFT JOIN (SELECT `faq_statistics`.`faq_id`, MAX(stat_date) AS `stat_date`, COUNT(stat_id) AS `stat_id` FROM `faq_statistics` GROUP BY `faq_id`) AS `fs` ON fa.faq_id = fs.faq_id WHERE (fa.faq_id = 4618)
0.00085306167602539
SELECT SQL_CALC_FOUND_ROWS `us`.`user_id`, `us`.`allow_delete` AS `editable`, `us`.`type`, CASE WHEN (SELECT COUNT(user_id) FROM `users_groups` AS `ug` WHERE (ug.user_id = us.user_id)) > 0 THEN 'N' ELSE 'Y' END AS `unassigned`, `us`.`active`, `us`.`ldap_user`, `us`.`login`, `us`.`fname`, `us`.`lname`, `us`.`email`, CONCAT_WS(' ', us.fname,us.lname) AS `text` FROM `users` AS `us` WHERE (us.login != 'sales@web-site-scripts.com') AND (us.account_id = 2) AND (us.type = 'staff' AND us.active <> 'P' AND (SELECT COUNT(user_id) FROM `users_groups` AS `ug` WHERE (ug.user_id = us.user_id)) > 0) ORDER BY `login` ASC
0.0003809928894043
SELECT FOUND_ROWS()
0.00063610076904297
SELECT `fa`.`revision_id`, `fa`.`revision_date` AS `date`, CONCAT_WS(' ', us.fname,us.lname) AS `author`, CONCAT_WS(' ', us_e.fname,us_e.lname) AS `editor` FROM `faq_history` AS `fa`
 LEFT JOIN `users` AS `us` ON fa.author = us.user_id
 LEFT JOIN `users` AS `us_e` ON fa.editor = us_e.user_id WHERE (fa.faq_id = 4618) ORDER BY `date` DESC
0.00050592422485352
SELECT `faq_articles`.`freeAccess`, `faq_articles`.`account_id` FROM `faq_articles` WHERE (faq_id = 4618)
0.0019278526306152
SELECT DISTINCT `g`.`group_id`, `g`.`name`, `g`.`description`, `g`.`allow_delete` FROM `articles_categories` AS `ac`
 LEFT JOIN `groups_categories_permissions` AS `gcp` ON ac.category_id = gcp.category_id OR gcp.category_id = 0
 LEFT JOIN `groups` AS `g` ON g.group_id = gcp.group_id WHERE (ac.faq_id = 4618) AND (g.account_id = 2) ORDER BY `g`.`name` ASC
0.0061039924621582
SELECT COUNT(*) AS `num` FROM `drafts` WHERE (account_id = 2) AND (user_id = -1) AND (question NOT LIKE '' OR answer NOT LIKE '')
0.0062699317932129
SELECT `dr`.`faq_id`, `dr`.`draft_id`, `dr`.`draft_date`, `dr`.`question`, `dr`.`answer`, `fa`.`draft`, CONCAT_WS(' ', us.fname,us.lname) AS `author_login`, CONCAT_WS(' ', us_e.fname,us_e.lname) AS `editor_login` FROM `drafts` AS `dr`
 LEFT JOIN `faq_articles` AS `fa` ON dr.faq_id = fa.faq_id
 LEFT JOIN `users` AS `us` ON fa.author = us.user_id
 LEFT JOIN `users` AS `us_e` ON fa.editor = us_e.user_id WHERE (dr.faq_id = 4618) AND (dr.user_id = -1) AND ((fa.faq_date < dr.draft_date OR fa.status_change_date < dr.draft_date))
0.00078296661376953
UPDATE `faq_articles` SET `views` = ? WHERE (faq_id = 4618)
0.00057601928710938
SELECT `terms`.`term_id`, `terms`.`term`, `terms`.`term_description` AS `description` FROM `terms` WHERE (account_id = 2)
0.00056314468383789
SELECT SQL_CALC_FOUND_ROWS `faq_attachments`.`faq_attachment_id` AS `id`, `faq_attachments`.`attach_name` AS `name`, `faq_attachments`.`file_path` AS `path`, `faq_attachments`.`mime_type` AS `type`, `faq_attachments`.`file_name` FROM `faq_attachments` WHERE (faq_id = 4618) ORDER BY `name` ASC
0.00041389465332031
SELECT FOUND_ROWS()
0.00071907043457031
SELECT `g`.`group_id` AS `gid`, `g`.`name`, `g`.`allow_delete`, `g`.`description`, `g`.`type`, (SELECT COUNT(user_id) FROM `users_groups` AS `ug` WHERE (ug.group_id = g.group_id)) AS `users_count` FROM `groups` AS `g` WHERE (account_id = 2) ORDER BY `name` ASC
0.0053799152374268
SELECT `ac`.`category_id` FROM `articles_categories` AS `ac`
 INNER JOIN `tmp_visible_articles_20101` AS `tmp` ON ac.faq_id = tmp.faq_id UNION SELECT `fc`.`cat_id` AS `category_id` FROM `faq_categories` AS `fc` WHERE (fc.`public` = 'Y') AND (fc.account_id = 2)
0.015703201293945
SELECT `fc`.`cat_id` AS `id`, `fc`.`parent_id` AS `pid`, `fc`.`cat_name` AS `text`, `fc`.`position`, `fc`.`meta_keywords`, `fc`.`meta_description`, `fc`.`public`, CASE WHEN childCount.`count` IS NULL
                                                                                 THEN 0
                                                                                 ELSE childCount.`count`
                                                                             END  AS `childCount`, CASE WHEN totalArticles.`count` IS NULL
                                                                                    THEN 0
                                                                                    ELSE totalArticles.`count`
                                                                                END  AS `totalArticles` FROM `faq_categories` AS `fc`
 LEFT JOIN (SELECT `faq_categories`.`parent_id`, COUNT(cat_id) AS `count` FROM `faq_categories` GROUP BY `parent_id`) AS `childCount` ON childCount.parent_id = fc.cat_id
 LEFT JOIN (SELECT `ac`.`category_id`, COUNT(ac.faq_id) AS `count` FROM `articles_categories` AS `ac`
 INNER JOIN `tmp_visible_articles_20101` AS `tmp` ON ac.faq_id = tmp.faq_id GROUP BY `category_id`) AS `totalArticles` ON totalArticles.category_id = fc.cat_id WHERE (fc.account_id = 2) ORDER BY `fc`.`position` ASC, `fc`.`cat_name` ASC
0.00066089630126953
SELECT `gcp`.`category_id` FROM `users_groups` AS `ug`
 LEFT JOIN `groups_permissions` AS `gp` ON gp.group_id = ug.group_id
 LEFT JOIN `groups_categories_permissions` AS `gcp` ON gcp.group_id = gp.group_id WHERE (user_id = -1) AND (gp.permission = 'ActPrmCategoryCreateEdit') AND (gp.value = '1')
0.00048995018005371
SELECT `gcp`.`category_id` FROM `users_groups` AS `ug`
 LEFT JOIN `groups_permissions` AS `gp` ON gp.group_id = ug.group_id
 LEFT JOIN `groups_categories_permissions` AS `gcp` ON gcp.group_id = gp.group_id WHERE (user_id = -1) AND (gp.permission = 'ActPrmCategoryDelete') AND (gp.value = '1')
0.00061893463134766
SELECT `gcp`.`category_id` FROM `users_groups` AS `ug`
 LEFT JOIN `groups_permissions` AS `gp` ON gp.group_id = ug.group_id
 LEFT JOIN `groups_categories_permissions` AS `gcp` ON gcp.group_id = gp.group_id WHERE (user_id = -1) AND (gp.permission = 'ActPrmArticleCreateEdit') AND (gp.value = '1')
0.00048303604125977
SELECT `gcp`.`category_id` FROM `users_groups` AS `ug`
 LEFT JOIN `groups_permissions` AS `gp` ON gp.group_id = ug.group_id
 LEFT JOIN `groups_categories_permissions` AS `gcp` ON gcp.group_id = gp.group_id WHERE (user_id = -1) AND (gp.permission = 'ActPrmArticleDelete') AND (gp.value = '1')
0.0026259422302246
SELECT `fa`.`faq_id` AS `faqId`, `fa`.`question`, `fa`.`code`, `fa`.`featured`, `fa`.`rating`, `fa`.`views`, CASE
                                                     WHEN (`public` = 'Y' AND (((public_start_date <= '2013-05-24 00:30:03') OR (public_start_date IS NULL))
                                                            AND (public_end_date IS NULL OR public_end_date >= '2013-05-24 00:30:03')))
                                                     THEN 'Y'
                                                     ELSE 'N'
                                                  END  AS `public`, `fa`.`faq_date` AS `date`, `fa`.`status_change_date` AS `lastEditDate`, `ac`.`category_id` FROM `faq_articles` AS `fa`
 INNER JOIN `tmp_visible_articles_20101` AS `tmp` ON fa.faq_id = tmp.faq_id
 LEFT JOIN `articles_categories` AS `ac` ON ac.faq_id = fa.faq_id WHERE (ac.category_id IN (8,17,35,36) ) ORDER BY `fa`.`featured` ASC, `fa`.`question` asc
0.0009760856628418
SELECT `tpl_layouts`.`layout_id`, `tpl_layouts`.`template` FROM `tpl_layouts` WHERE (theme_id = 4) AND (layout_name = 'Article')
0.0012600421905518
SELECT `lb`.`block_id`, `lbc`.`block_name`, `lbc`.`template` FROM `tpl_layouts_blocks` AS `lb`
 INNER JOIN `tpl_blocks` AS `lbc` ON lbc.block_id = lb.block_id WHERE (layout_id = 59)
0.0013949871063232
SELECT `tpl_snippets`.`template`, `tpl_snippets`.`snippet_name`, `tpl_snippets`.`block_id` FROM `tpl_snippets` WHERE (theme_id = 4)
0.00044512748718262
SELECT `languages`.`lang_id` FROM `languages` WHERE (lang = 'def')
0.0076429843902588
SELECT `languages_vars`.`language_var`, `languages_vars`.`value` FROM `languages_vars` WHERE (lang_id = 1) AND (type != 'notification')
0.0079851150512695
SELECT `languages_vars`.`language_var`, `languages_vars`.`value` FROM `languages_vars` WHERE (lang_id = 2) AND (type != 'notification')
Max Query Time:Query:
0.12953019142151
SELECT `fa`.`faq_id` AS `faqId`, `fa`.`question`, `fa`.`code`, `fa`.`views`, `fa`.`rating`, `fa`.`featured`, `fa`.`answer`, CASE
                                            WHEN (`public` = 'Y' AND (((public_start_date <= '2013-05-24 00:30:03') OR (public_start_date IS NULL))
                                                    AND (public_end_date IS NULL OR public_end_date >= '2013-05-24 00:30:03')))
                                            THEN 'Y'
                                            ELSE 'N'
                                        END  AS `public`, `fa`.`faq_date` AS `date`, `fa`.`status_change_date` AS `lastEditDate`, `fa`.`public_start_date` AS `publicStartDate` FROM `faq_articles` AS `fa` WHERE (fa.faq_id IN (4873,4872,4871,4870,4869,4865,4864,4863,4862,4861)) AND (fa.status = 'moderated') ORDER BY `fa`.`real_creation_date` DESC, `faq_id` DESC
Total SQL Time:Queries Num:
0.65938305854797
158