• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Awaiting More Details Suggestions for better performance?

kontrabass

Member
AMS Premium
CAS Premium
RMS Premium
SC Premium
Hi Bob!

We're days into our Xenforo 2 upgrade, along with it we've imported our entire classifieds forums into CAS.

Page loads are snappy on all other pages in the site, but everything in CAS is slow. Like 6-10 seconds loading a page.

I've got people looking into the server, mysql queries etc., but just wanted to see if you knew of any tips or tweaks to help.

 
Hi Bob!

We're days into our Xenforo 2 upgrade, along with it we've imported our entire classifieds forums into CAS.

Page loads are snappy on all other pages in the site, but everything in CAS is slow. Like 6-10 seconds loading a page.

I've got people looking into the server, mysql queries etc., but just wanted to see if you knew of any tips or tweaks to help.

Didn't we already resolve this a few weeks ago with the solution by Xon?
 
Didn't we already resolve this a few weeks ago with the solution by Xon?
That solution is in place, and it drastically helped (index wouldn't load for over 10 seconds previously). We're looking into the logs to see what causing general sluggishness now.
 
That solution is in place, and it drastically helped (index wouldn't load for over 10 seconds previously). We're looking into the logs to see what causing general sluggishness now.
Might want to double check the indexes on the xf_xa_cas_ad and xf_xa_cas_category tables.

Things like setting the default sort order to a sort type that doesn't have an index would slow things down if there is a significant amount of rows of data in a table that is performing a full table scan when there is no appropriate index in place.

Also, having too many widgets is going to add to the page load.

Also, displaying Ads (like Google Adsense) is going to significantly cause slow page loads, something that a lot of people overlook.

So when testing, its best to disable all the "extras" like Widgets, Google Ads (ads from any network), sidebar blocks, feature block etc.. That way its only the Index of CAS Ads (or if viewing an Ad, only the Ad itself and not a ton of blocks and widgets AND ADS.
 
Might want to double check the indexes on the xf_xa_cas_ad and xf_xa_cas_category tables.

Things like setting the default sort order to a sort type that doesn't have an index would slow things down if there is a significant amount of rows of data in a table that is performing a full table scan when there is no appropriate index in place.

Also, having too many widgets is going to add to the page load.

Also, displaying Ads (like Google Adsense) is going to significantly cause slow page loads, something that a lot of people overlook.

So when testing, its best to disable all the "extras" like Widgets, Google Ads (ads from any network), sidebar blocks, feature block etc.. That way its only the Index of CAS Ads (or if viewing an Ad, only the Ad itself and not a ton of blocks and widgets AND ADS.
Bob, my server admin is asking, is there a list of what indexes should be on those tables?
 
Bob, my server admin is asking, is there a list of what indexes should be on those tables?
The install file (Setup.php) has the indexes that are created ...

PHP:
        $tables['xf_xa_cas_ad'] = function(Create $table)
        {
            [...]
            $table->addKey(['category_id', 'create_date'], 'category_create_date');
            $table->addKey(['category_id', 'last_update'], 'category_last_update');
            $table->addKey(['category_id', 'ad_type'], 'category_ad_type');
            $table->addKey(['category_id', 'ad_status'], 'category_ad_status');
            $table->addKey(['category_id', 'is_sponsored', 'last_update']);
            $table->addKey(['user_id', 'last_update']);
            $table->addKey(['is_sponsored', 'last_update']);
            $table->addKey('create_date');
            $table->addKey('last_update');
            $table->addKey('ad_type');
            $table->addKey('ad_status');
            $table->addKey('is_sponsored');
            $table->addKey('discussion_thread_id');
            $table->addKey('prefix_id');
        };


        $tables['xf_xa_cas_category'] = function(Create $table)
        {
            [...]
            $table->addKey(['parent_category_id', 'lft']);
            $table->addKey(['lft', 'rgt']);
        };
 
Last edited:
  • Like
Reactions: Bob
The install file (Setup.php) has the indexes that are created ...
This is true for XF 2.2 and older versions.

Starting with XF 2.3.0 stable versions of my addons, table structure/data is located in src/addons/XenAddons/[AddonId]/Install/Data/MySQL.php (both XFRM and XFMG maed this change, which follows Core XF, so I decided to do the same).
 
Confirmed all indexes seem to be there. Server admin thinks maybe a MariaDB upgrade will help (we're on 10.3).

These queries are always in the processlist, with run times 4-5 secs or more:

| SELECT `xf_xa_cas_comment`.*, `xf_xa_cas_ad_Ad_1`.*, `xf_user_User_2`.*, `xf_user_profile_Profile_3`.*, `xf_session_activity_Activity_4`.*, `xf_reaction_content_Reactions_5`.*
FROM `xf_xa_cas_comment`
LEFT JOIN `xf_xa_cas_ad` AS `xf_xa_cas_ad_Ad_1` ON (`xf_xa_cas_ad_Ad_1`.`ad_id` = `xf_xa_cas_comment`.`ad_id`)
LEFT JOIN `xf_user` AS `xf_user_User_2` ON (`xf_user_User_2`.`user_id` = `xf_xa_cas_comment`.`user_id`)
LEFT JOIN `xf_user_profile` AS `xf_user_profile_Profile_3` ON (`xf_user_profile_Profile_3`.`user_id` = `xf_user_User_2`.`user_id`)
LEFT JOIN `xf_session_activity` AS `xf_session_activity_Activity_4` ON (`xf_session_activity_Activity_4`.`user_id` = `xf_user_User_2`.`user_id` AND `xf_session_activity_Activity_4`.`unique_key` = CONCAT(`xf_user_User_2`.`user_id`, ''))
LEFT JOIN `xf_reaction_content` AS `xf_reaction_content_Reactions_5` ON (`xf_reaction_content_Reactions_5`.`content_type` = 'cas_comment' AND `xf_reaction_content_Reactions_5`.`content_id` = `xf_xa_cas_comment`.`comment_id` AND `xf_reaction_content_Reactions_5`.`reaction_user_id` = '39455')
WHERE (`xf_xa_cas_comment`.`ad_id` = 1655635) AND ((`xf_xa_cas_comment`.`comment_state` = 'moderated' AND `xf_xa_cas_comment`.`user_id` = 39455) OR (`xf_xa_cas_comment`.`comment_state` IN ('visible')))
ORDER BY `xf_xa_cas_comment`.`comment_date` ASC, `xf_xa_cas_comment`.`comment_id` ASC
 
Confirmed all indexes seem to be there. Server admin thinks maybe a MariaDB upgrade will help (we're on 10.3).

These queries are always in the processlist, with run times 4-5 secs or more:

| SELECT `xf_xa_cas_comment`.*, `xf_xa_cas_ad_Ad_1`.*, `xf_user_User_2`.*, `xf_user_profile_Profile_3`.*, `xf_session_activity_Activity_4`.*, `xf_reaction_content_Reactions_5`.*
FROM `xf_xa_cas_comment`
LEFT JOIN `xf_xa_cas_ad` AS `xf_xa_cas_ad_Ad_1` ON (`xf_xa_cas_ad_Ad_1`.`ad_id` = `xf_xa_cas_comment`.`ad_id`)
LEFT JOIN `xf_user` AS `xf_user_User_2` ON (`xf_user_User_2`.`user_id` = `xf_xa_cas_comment`.`user_id`)
LEFT JOIN `xf_user_profile` AS `xf_user_profile_Profile_3` ON (`xf_user_profile_Profile_3`.`user_id` = `xf_user_User_2`.`user_id`)
LEFT JOIN `xf_session_activity` AS `xf_session_activity_Activity_4` ON (`xf_session_activity_Activity_4`.`user_id` = `xf_user_User_2`.`user_id` AND `xf_session_activity_Activity_4`.`unique_key` = CONCAT(`xf_user_User_2`.`user_id`, ''))
LEFT JOIN `xf_reaction_content` AS `xf_reaction_content_Reactions_5` ON (`xf_reaction_content_Reactions_5`.`content_type` = 'cas_comment' AND `xf_reaction_content_Reactions_5`.`content_id` = `xf_xa_cas_comment`.`comment_id` AND `xf_reaction_content_Reactions_5`.`reaction_user_id` = '39455')
WHERE (`xf_xa_cas_comment`.`ad_id` = 1655635) AND ((`xf_xa_cas_comment`.`comment_state` = 'moderated' AND `xf_xa_cas_comment`.`user_id` = 39455) OR (`xf_xa_cas_comment`.`comment_state` IN ('visible')))
ORDER BY `xf_xa_cas_comment`.`comment_date` ASC, `xf_xa_cas_comment`.`comment_id` ASC
How many CAS Comment Widgets do you have created and where are those being displayed? Did you temp disable those on the page that you were testing? eg, if CAS Index is slow, disable the Recent Comments Widget to see if that might be the issue.

When troubleshooting page load issues, the first thing I do is disable all Widgets (those can add a lot of load time) and any optional "blocks" of content (so that its just the main index page without all the additional load. Then go back and start enabling them again (testing between each one) to see if there is a specific widget or block that is adding additional load.
 
I have 0 widgets enabled or created. The classified index pages seem to be ok, but it'll take sometimes 12 seconds to load an individual ad.

NVM didn't realize latest comments widget was there. On it.
 
Each Tab of a Classified Ad has its own action in the controller that fetches data for that specific tab.

Is it the Overview Tab that you are talking about? If so, have you disable all of the optional blocks for the Overview page so that its only the Ad and not all of the optional extra's?

Can you activate debug mode and then view the debug page for the page that you are viewing. That will display all of the queries involved and the execution time for each query. Anything over 1 is considered a "slow" query (altho, some of that could be database performance and not necessarily a fetching issue).

I always find it best to disable as many things as possible so that you are testing with barebones (and default enables a lot of optional blocks, so unless you already disabled them, there are a lot of them pre-enabled).
 
btw, CAS will be taking advantage of Deferred Joins (new to XF 2.3) for sub content like Items, Comments, Offers, Questions, Transactions, Updates etc.

Deferred joins​

Enter "deferred joins"! This is actually a new feature in the core of XenForo, albeit currently only used within Media Gallery. For the developers amongst you, all it really means is you will call $finder->fetchDeferred() rather than $finder->fetch(), and for the non-developers amongst you, what it means is "slow query go fast" 😉

Behind the scenes what actually happens is rather than executing a single query, it executes two! Which may seem counter-intuitive but bear with me. The first query simply aims to fetch the applicable IDs for the conditions and page you are on which is fast because it uses the primary key, whereas the second query fetches all of the data applicable with all of the joins but matching those specific IDs fetched from the first query.

To cut a very long story short, if you take the page 45,252 example from above, this same query reduced from over 30 seconds to only 2 seconds. While 2 seconds might still seem a little on the high side, this is a 93% decrease from before, and it's only as high as it is because of the high page number. The upshot is that the sheer majority of those 45,000+ pages will now be remarkably faster to load than before. This will not only massively decrease frustration of your users, but it will significantly increase the likelihood of these pages being crawled by search engines and dramatically decrease the load on your database.

 
Each Tab of a Classified Ad has its own action in the controller that fetches data for that specific tab.

Is it the Overview Tab that you are talking about? If so, have you disable all of the optional blocks for the Overview page so that its only the Ad and not all of the optional extra's?

Can you activate debug mode and then view the debug page for the page that you are viewing. That will display all of the queries involved and the execution time for each query. Anything over 1 is considered a "slow" query (altho, some of that could be database performance and not necessarily a fetching issue).

I always find it best to disable as many things as possible so that you are testing with barebones (and default enables a lot of optional blocks, so unless you already disabled them, there are a lot of them pre-enabled).

Hi Bob,

We just upgraded to MariaDB 10.11

It seems to have sped up ad load times considerably but it's still slower than optimal. I will look at all the queries and see what I can find. Trying to enable debug mode for just my IP but I think cloudflare is messing with it. I have turned off all widgets, "more from this seller", and "more in this category" blocks.

My sysadmin just sent this:

Also the classified query that is slow seems to processing all the comments on ads given there like 2 million to process , Here is a sample query,

| 17080 | xf2014 | 127.0.0.1:34932 | xenforo3 | Execute | 7 | Sending data | SELECT `xf_xa_cas_comment`.*, `xf_xa_cas_ad_Ad_1`.*, `xf_user_User_2`.*, `xf_user_profile_Profile_3`.*, `xf_session_activity_Activity_4`.*
FROM `xf_xa_cas_comment`
LEFT JOIN `xf_xa_cas_ad` AS `xf_xa_cas_ad_Ad_1` ON (`xf_xa_cas_ad_Ad_1`.`ad_id` = `xf_xa_cas_comment`.`ad_id`)
LEFT JOIN `xf_user` AS `xf_user_User_2` ON (`xf_user_User_2`.`user_id` = `xf_xa_cas_comment`.`user_id`)
LEFT JOIN `xf_user_profile` AS `xf_user_profile_Profile_3` ON (`xf_user_profile_Profile_3`.`user_id` = `xf_user_User_2`.`user_id`)
LEFT JOIN `xf_session_activity` AS `xf_session_activity_Activity_4` ON (`xf_session_activity_Activity_4`.`user_id` = `xf_user_User_2`.`user_id` AND `xf_session_activity_Activity_4`.`unique_key` = CONCAT(`xf_user_User_2`.`user_id`, ''))
WHERE (`xf_xa_cas_comment`.`ad_id` = 1610437) AND ((`xf_xa_cas_comment`.`comment_state` IN ('visible')))
ORDER BY `xf_xa_cas_comment`.`comment_date` ASC, `xf_xa_cas_comment`.`comment_id` ASC

LIMIT 20 | 0.000 |


and here is the explain plan,

MariaDB [xenforo3]> explain extended SELECT `xf_xa_cas_comment`.*, `xf_xa_cas_ad_Ad_1`.*, `xf_user_User_2`.*, `xf_user_profile_Profile_3`.*, `xf_session_activity_Activity_4`.* FROM `xf_xa_cas_comment` LEFT JOIN `xf_xa_cas_ad` AS `xf_xa_cas_ad_Ad_1` ON (`xf_xa_cas_ad_Ad_1`.`ad_id` = `xf_xa_cas_comment`.`ad_id`) LEFT JOIN `xf_user` AS `xf_user_User_2` ON (`xf_user_User_2`.`user_id` = `xf_xa_cas_comment`.`user_id`) LEFT JOIN `xf_user_profile` AS `xf_user_profile_Profile_3` ON (`xf_user_profile_Profile_3`.`user_id` = `xf_user_User_2`.`user_id`) LEFT JOIN `xf_session_activity` AS `xf_session_activity_Activity_4` ON (`xf_session_activity_Activity_4`.`user_id` = `xf_user_User_2`.`user_id` AND `xf_session_activity_Activity_4`.`unique_key` = CONCAT(`xf_user_User_2`.`user_id`, '')) WHERE (`xf_xa_cas_comment`.`ad_id` = 868721) AND ((`xf_xa_cas_comment`.`comment_state` IN ('visible'))) ORDER BY `xf_xa_cas_comment`.`comment_date` ASC, `xf_xa_cas_comment`.`comment_id` ASC;
+------+-------------+--------------------------------+--------+---------------+---------+---------+--------------------------------------+---------+----------+-----------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+------+-------------+--------------------------------+--------+---------------+---------+---------+--------------------------------------+---------+----------+-----------------------------+
| 1 | SIMPLE | xf_xa_cas_comment | ALL | NULL | NULL | NULL | NULL | 2669449 | 100.00 | Using where; Using filesort |
| 1 | SIMPLE | xf_xa_cas_ad_Ad_1 | const | PRIMARY | PRIMARY | 4 | const | 1 | 100.00 | |
| 1 | SIMPLE | xf_user_User_2 | eq_ref | PRIMARY | PRIMARY | 4 | xenforo3.xf_xa_cas_comment.user_id | 1 | 100.00 | |
| 1 | SIMPLE | xf_user_profile_Profile_3 | eq_ref | PRIMARY | PRIMARY | 4 | xenforo3.xf_user_User_2.user_id | 1 | 100.00 | Using where |
| 1 | SIMPLE | xf_session_activity_Activity_4 | eq_ref | PRIMARY | PRIMARY | 22 | xenforo3.xf_user_User_2.user_id,func | 1 | 100.00 | Using where |
+------+-------------+--------------------------------+--------+---------------+---------+---------+--------------------------------------+---------+----------+-----------------------------+
5 rows in set, 1 warning (0.001 sec)
 
Each Tab of a Classified Ad has its own action in the controller that fetches data for that specific tab.

Is it the Overview Tab that you are talking about? If so, have you disable all of the optional blocks for the Overview page so that its only the Ad and not all of the optional extra's?

Can you activate debug mode and then view the debug page for the page that you are viewing. That will display all of the queries involved and the execution time for each query. Anything over 1 is considered a "slow" query (altho, some of that could be database performance and not necessarily a fetching issue).

I always find it best to disable as many things as possible so that you are testing with barebones (and default enables a lot of optional blocks, so unless you already disabled them, there are a lot of them pre-enabled).

Bob, after enabling debug mode, the page load times for CAS index is 1.6s on average. Item pages, about .7s. It doesn't seem bad, but when the rest of the site loads with a .05 to .1 second query time, the classifieds do seem quite sluggish. Enabling a couple widgets on the index page does not increase query times.

This is the longest query of the 40-some that are logged, at .64s:

7.
SELECT `xf_xa_cas_ad`.`ad_id`
FROM `xf_xa_cas_ad`
LEFT JOIN `xf_user` AS `xf_user_User_1` ON (`xf_user_User_1`.`user_id` = `xf_xa_cas_ad`.`user_id`)
LEFT JOIN `xf_xa_cas_ad_feature` AS `xf_xa_cas_ad_feature_Featured_2` ON (`xf_xa_cas_ad_feature_Featured_2`.`ad_id` = `xf_xa_cas_ad`.`ad_id`)
LEFT JOIN `xf_xa_cas_ad_sponsor` AS `xf_xa_cas_ad_sponsor_Sponsored_3` ON (`xf_xa_cas_ad_sponsor_Sponsored_3`.`ad_id` = `xf_xa_cas_ad`.`ad_id`)
LEFT JOIN `xf_attachment` AS `xf_attachment_CoverImage_4` ON (`xf_attachment_CoverImage_4`.`content_type` = 'cas_ad' AND `xf_attachment_CoverImage_4`.`content_id` = `xf_xa_cas_ad`.`ad_id` AND `xf_attachment_CoverImage_4`.`attachment_id` = `xf_xa_cas_ad`.`cover_image_id`)
LEFT JOIN `xf_attachment_data` AS `xf_attachment_data_Data_5` ON (`xf_attachment_data_Data_5`.`data_id` = `xf_attachment_CoverImage_4`.`data_id`)
LEFT JOIN `xf_xa_cas_ad_read` AS `xf_xa_cas_ad_read_Read_6` ON (`xf_xa_cas_ad_read_Read_6`.`ad_id` = `xf_xa_cas_ad`.`ad_id` AND `xf_xa_cas_ad_read_Read_6`.`user_id` = '1')
LEFT JOIN `xf_xa_cas_ad_watch` AS `xf_xa_cas_ad_watch_Watch_7` ON (`xf_xa_cas_ad_watch_Watch_7`.`ad_id` = `xf_xa_cas_ad`.`ad_id` AND `xf_xa_cas_ad_watch_Watch_7`.`user_id` = '1')
LEFT JOIN `xf_reaction_content` AS `xf_reaction_content_Reactions_8` ON (`xf_reaction_content_Reactions_8`.`content_type` = 'cas_ad' AND `xf_reaction_content_Reactions_8`.`content_id` = `xf_xa_cas_ad`.`ad_id` AND `xf_reaction_content_Reactions_8`.`reaction_user_id` = '1')
LEFT JOIN `xf_bookmark_item` AS `xf_bookmark_item_Bookmarks_9` ON (`xf_bookmark_item_Bookmarks_9`.`content_type` = 'cas_ad' AND `xf_bookmark_item_Bookmarks_9`.`content_id` = `xf_xa_cas_ad`.`ad_id` AND `xf_bookmark_item_Bookmarks_9`.`user_id` = '1')
LEFT JOIN `xf_xa_cas_category` AS `xf_xa_cas_category_Category_10` ON (`xf_xa_cas_category_Category_10`.`category_id` = `xf_xa_cas_ad`.`category_id`)
LEFT JOIN `xf_xa_cas_category_watch` AS `xf_xa_cas_category_watch_Watch_11` ON (`xf_xa_cas_category_watch_Watch_11`.`category_id` = `xf_xa_cas_category_Category_10`.`category_id` AND `xf_xa_cas_category_watch_Watch_11`.`user_id` = '1')
LEFT JOIN `xf_deletion_log` AS `xf_deletion_log_DeletionLog_12` ON (`xf_deletion_log_DeletionLog_12`.`content_type` = 'cas_ad' AND `xf_deletion_log_DeletionLog_12`.`content_id` = `xf_xa_cas_ad`.`ad_id`)
WHERE (`xf_xa_cas_ad`.`category_id` IN (126, 127, 213, 129, 182, 11, 144, 145, 270, 13, 139, 172, 178, 271, 210)) AND ((`xf_xa_cas_ad`.`ad_state` IN ('visible', 'deleted', 'moderated'))) AND (`xf_xa_cas_ad`.`ad_status` = 'open')
ORDER BY `xf_xa_cas_ad`.`last_update` DESC
Run Time: 0.645228
Select TypeTableTypePossible KeysKeyKey LenRefRowsExtra
SIMPLExf_xa_cas_adrefcategory_create_date,category_last_update,category_ad_type,category_ad_status,ad_statusad_status1const214722Using index condition; Using where; Using filesort
SIMPLExf_attachment_CoverImage_4eq_refPRIMARY,content_type_id_datePRIMARY4xenforo3.xf_xa_cas_ad.cover_image_id1Using where
SIMPLExf_xa_cas_category_Category_10eq_refPRIMARYPRIMARY4xenforo3.xf_xa_cas_ad.category_id1Using index
  1. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 96
  2. XF\Db\AbstractAdapter->query() in src/XF/Mvc/Entity/Finder.php at line 1474
  3. XF\Mvc\Entity\Finder->fetchRaw() in src/XF/Mvc/Entity/Finder.php at line 1489
  4. XF\Mvc\Entity\Finder->fetchColumns() in src/addons/AL/FilterFramework/Service/ContextProvider.php at line 750
  5. AL\FilterFramework\Service\ContextProvider->executeFacetedSearch() in src/addons/AL/CASFilter/App.php at line 29
  6. AL\CASFilter\App::AL\CASFilter\{closure}()
  7. call_user_func() in src/addons/AL/CASFilter/XenAddons/CAS/ControllerPlugin/FilterContainerTrait.php at line 202
  8. AL\CASFilter\XenAddons\CAS\ControllerPlugin\AdList->applyAdFilters() in src/addons/XenAddons/CAS/ControllerPlugin/AdList.php at line 38
  9. XenAddons\CAS\ControllerPlugin\AdList->getAdListData() in src/addons/XenAddons/CAS/Pub/Controller/Ad.php at line 45
  10. XenAddons\CAS\Pub\Controller\Ad->actionIndex() in src/addons/AL/CASFilter/XenAddons/CAS/Pub/Controller/Ad.php at line 16
  11. AL\CASFilter\XenAddons\CAS\Pub\Controller\Ad->actionIndex() in src/XF/Mvc/Dispatcher.php at line 352
  12. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 258
  13. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
  14. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
  15. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2485
  16. XF\App->run() in src/XF.php at line 524
  17. XF::runApp() in index.php at line 2

And then this one at .3s:


  1. SELECT `xf_xa_cas_ad`.*, `xf_user_User_1`.*, `xf_xa_cas_ad_feature_Featured_2`.*, `xf_xa_cas_ad_sponsor_Sponsored_3`.*, `xf_attachment_CoverImage_4`.*, `xf_attachment_data_Data_5`.*, `xf_xa_cas_ad_read_Read_6`.*, `xf_xa_cas_ad_watch_Watch_7`.*, `xf_reaction_content_Reactions_8`.*, `xf_bookmark_item_Bookmarks_9`.*, `xf_xa_cas_category_Category_10`.*, `xf_xa_cas_category_watch_Watch_11`.*, `xf_deletion_log_DeletionLog_12`.*
    FROM `xf_xa_cas_ad`
    LEFT JOIN `xf_user` AS `xf_user_User_1` ON (`xf_user_User_1`.`user_id` = `xf_xa_cas_ad`.`user_id`)
    LEFT JOIN `xf_xa_cas_ad_feature` AS `xf_xa_cas_ad_feature_Featured_2` ON (`xf_xa_cas_ad_feature_Featured_2`.`ad_id` = `xf_xa_cas_ad`.`ad_id`)
    LEFT JOIN `xf_xa_cas_ad_sponsor` AS `xf_xa_cas_ad_sponsor_Sponsored_3` ON (`xf_xa_cas_ad_sponsor_Sponsored_3`.`ad_id` = `xf_xa_cas_ad`.`ad_id`)
    LEFT JOIN `xf_attachment` AS `xf_attachment_CoverImage_4` ON (`xf_attachment_CoverImage_4`.`content_type` = 'cas_ad' AND `xf_attachment_CoverImage_4`.`content_id` = `xf_xa_cas_ad`.`ad_id` AND `xf_attachment_CoverImage_4`.`attachment_id` = `xf_xa_cas_ad`.`cover_image_id`)
    LEFT JOIN `xf_attachment_data` AS `xf_attachment_data_Data_5` ON (`xf_attachment_data_Data_5`.`data_id` = `xf_attachment_CoverImage_4`.`data_id`)
    LEFT JOIN `xf_xa_cas_ad_read` AS `xf_xa_cas_ad_read_Read_6` ON (`xf_xa_cas_ad_read_Read_6`.`ad_id` = `xf_xa_cas_ad`.`ad_id` AND `xf_xa_cas_ad_read_Read_6`.`user_id` = '1')
    LEFT JOIN `xf_xa_cas_ad_watch` AS `xf_xa_cas_ad_watch_Watch_7` ON (`xf_xa_cas_ad_watch_Watch_7`.`ad_id` = `xf_xa_cas_ad`.`ad_id` AND `xf_xa_cas_ad_watch_Watch_7`.`user_id` = '1')
    LEFT JOIN `xf_reaction_content` AS `xf_reaction_content_Reactions_8` ON (`xf_reaction_content_Reactions_8`.`content_type` = 'cas_ad' AND `xf_reaction_content_Reactions_8`.`content_id` = `xf_xa_cas_ad`.`ad_id` AND `xf_reaction_content_Reactions_8`.`reaction_user_id` = '1')
    LEFT JOIN `xf_bookmark_item` AS `xf_bookmark_item_Bookmarks_9` ON (`xf_bookmark_item_Bookmarks_9`.`content_type` = 'cas_ad' AND `xf_bookmark_item_Bookmarks_9`.`content_id` = `xf_xa_cas_ad`.`ad_id` AND `xf_bookmark_item_Bookmarks_9`.`user_id` = '1')
    LEFT JOIN `xf_xa_cas_category` AS `xf_xa_cas_category_Category_10` ON (`xf_xa_cas_category_Category_10`.`category_id` = `xf_xa_cas_ad`.`category_id`)
    LEFT JOIN `xf_xa_cas_category_watch` AS `xf_xa_cas_category_watch_Watch_11` ON (`xf_xa_cas_category_watch_Watch_11`.`category_id` = `xf_xa_cas_category_Category_10`.`category_id` AND `xf_xa_cas_category_watch_Watch_11`.`user_id` = '1')
    LEFT JOIN `xf_deletion_log` AS `xf_deletion_log_DeletionLog_12` ON (`xf_deletion_log_DeletionLog_12`.`content_type` = 'cas_ad' AND `xf_deletion_log_DeletionLog_12`.`content_id` = `xf_xa_cas_ad`.`ad_id`)
    WHERE (`xf_xa_cas_ad`.`category_id` IN (126, 127, 213, 129, 182, 11, 144, 145, 270, 13, 139, 172, 178, 271, 210)) AND ((`xf_xa_cas_ad`.`ad_state` IN ('visible', 'deleted', 'moderated'))) AND (`xf_xa_cas_ad`.`ad_status` = 'open')
    ORDER BY `xf_xa_cas_ad`.`last_update` DESC

    LIMIT 15
    Run Time: 0.330600
    Select TypeTableTypePossible KeysKeyKey LenRefRowsExtra
    SIMPLExf_xa_cas_adrefcategory_create_date,category_last_update,category_ad_type,category_ad_status,ad_statusad_status1const214722Using index condition; Using where; Using filesort
    SIMPLExf_user_User_1eq_refPRIMARYPRIMARY4xenforo3.xf_xa_cas_ad.user_id1
    SIMPLExf_xa_cas_ad_feature_Featured_2eq_refPRIMARYPRIMARY4xenforo3.xf_xa_cas_ad.ad_id1
    SIMPLExf_xa_cas_ad_sponsor_Sponsored_3eq_refPRIMARYPRIMARY4xenforo3.xf_xa_cas_ad.ad_id1
    SIMPLExf_attachment_CoverImage_4eq_refPRIMARY,content_type_id_datePRIMARY4xenforo3.xf_xa_cas_ad.cover_image_id1Using where
    SIMPLExf_attachment_data_Data_5eq_refPRIMARYPRIMARY4xenforo3.xf_attachment_CoverImage_4.data_id1Using where
    SIMPLExf_xa_cas_ad_read_Read_6eq_refuser_id_ad_id,ad_iduser_id_ad_id8const,xenforo3.xf_xa_cas_ad.ad_id1
    SIMPLExf_xa_cas_ad_watch_Watch_7refPRIMARY,ad_id_email_subscribead_id_email_subscribe4xenforo3.xf_xa_cas_ad.ad_id1Using where; Using index
    SIMPLExf_reaction_content_Reactions_8refcontent_type_id_user_id,content_type_id_reaction_date,reaction_user_idcontent_type_id_reaction_date31const,xenforo3.xf_xa_cas_ad.ad_id1Using where
    SIMPLExf_bookmark_item_Bookmarks_9rangeuser_id_content_type_content_id,content_type_content_iduser_id_content_type_content_id31 1Using where
    SIMPLExf_xa_cas_category_Category_10ALLPRIMARY 16Using where
    SIMPLExf_xa_cas_category_watch_Watch_11rangePRIMARY,node_id_notify_onPRIMARY4 1Using where
    SIMPLExf_deletion_log_DeletionLog_12eq_refPRIMARYPRIMARY31const,xenforo3.xf_xa_cas_ad.ad_id1Using where
    1. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 96
    2. XF\Db\AbstractAdapter->query() in src/XF/Mvc/Entity/Finder.php at line 1428
    3. XF\Mvc\Entity\Finder->fetch() in src/addons/XenAddons/CAS/ControllerPlugin/AdList.php at line 166
    4. XenAddons\CAS\ControllerPlugin\AdList->getAdListData() in src/addons/XenAddons/CAS/Pub/Controller/Ad.php at line 45
    5. XenAddons\CAS\Pub\Controller\Ad->actionIndex() in src/addons/AL/CASFilter/XenAddons/CAS/Pub/Controller/Ad.php at line 16
    6. AL\CASFilter\XenAddons\CAS\Pub\Controller\Ad->actionIndex() in src/XF/Mvc/Dispatcher.php at line 352
    7. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 258
    8. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
    9. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
    10. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2485
    11. XF\App->run() in src/XF.php at line 524
    12. XF::runApp() in index.php at line 20
 
Back
Top