vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   End-User Options - Starred Posts (https://vborg.vbsupport.ru/showthread.php?t=323063)

IggyP 08-19-2017 09:20 AM

installed and thank you...

my only thought was the the quick links can be easily overlooked for some....if it was in profile section with tags, quotes, likes etc....would be a better order....

not sure how difficult but just an idea

djbaxter 10-22-2017 10:43 PM

I was experiencing intermittent very slow posting and double posting after transfer to a new VPS.

We were able to identify some problem plugins in investigating this and it turns out this was one of them.

From the host tech support:

Quote:

It looks like there's a specific query being ran that's really slowing down your server.


Code:

SELECT * FROM `filedata`;
# Time: 171007 13:22:30
# User@Host: ###### @ localhost []
# Thread_id: 318579  Schema: #####  QC_hit: No
# Query_time: 7.152743  Lock_time: 0.000120  Rows_sent: 31  Rows_examined: 558
# Rows_affected: 0
SET timestamp=1507396950;
SELECT  post.pagetext AS preview,
                        thread.threadid, thread.title AS threadtitle, thread.forumid, thread.pollid, thread.open, thread.postusername, thread.$
                        thread.dateline, thread.notes, thread.visible, thread.sticky, thread.votetotal, thread.attach, thread.lastpost, thread$
                        thread.prefixid, thread.taglist, thread.hiddencount, thread.deletedcount, user.userid,
                        user.membergroupids, user.infractiongroupids, user.usergroupid, user.homepage, user.options AS useroptions, IF(userlis$
                        user.lastactivity, user.lastvisit, IF(user.options & 512, 1, 0) AS invisible


                        , (SELECT COUNT(*) FROM starposts AS starposts WHERE starposts.userid = 0 AND starposts.threadid = thread.threadid) $
                FROM thread AS thread
                        LEFT JOIN user AS user ON (user.userid = thread.lastposterid)
                        LEFT JOIN userlist AS userlist ON (userlist.relationid = user.userid AND userlist.type = 'buddy' AND userlist.userid$


                        LEFT JOIN post AS post ON(post.postid = thread.firstpostid)

                WHERE thread.threadid IN (0,32490,26504,31904,31744,31657,31635,31567,27852,31374,31276,27962,31157,30175,29848,29692,29680,29$
                ORDER BY thread.sticky DESC, lastpost DESC;

The reason it's taking so long, is that it's using LEFT JOIN commands that will take information from a previous query, and use it into that specific query which can really slow your server down.


MarkFL 10-22-2017 11:24 PM

In that particular query, my product is not adding any LEFT JOIN commands. If the problems began after moving to a new host, I would think that's where the issue really is, although host techs, from what I've read at least, are notorious for trying to lay blame on scripts. I have run this product on multiple sites with no slowdown issues. :)

djbaxter 10-22-2017 11:42 PM

So the LEFT JOIN parts are from something else? Meaning the part they quoted was from more than one database query?

And yes, the issues began after downsizing from a dedicated server to a VPS.

MarkFL 10-22-2017 11:50 PM

Yes, my product's contribution to that query can be found in the plugin hooked at "forumdisplay_query" which reads:

PHP Code:

global $vbulletin;

if (
$vbulletin->options['markfl_starpost_active'])
{
    
$hook_query_fields .= ', (SELECT COUNT(*) FROM ' TABLE_PREFIX 'starposts AS starposts WHERE starposts.userid = ' $vbulletin->userinfo['userid'] . ' AND starposts.threadid = thread.threadid) AS starcount';


The rest of the query (assuming no other products are adding to that query) can be found in the core vB script "forumdisplay.php" here:

PHP Code:

    ($hook vBulletinHook::fetch_hook('forumdisplay_query')) ? eval($hook) : false;

    
$threads $db->query_read_slave("
        SELECT 
$votequery $previewfield
            thread.threadid, thread.title AS threadtitle, thread.forumid, thread.pollid, thread.open, thread.postusername, thread.postuserid, thread.iconid AS threadiconid,
            thread.dateline, thread.notes, thread.visible, thread.sticky, thread.votetotal, thread.attach, 
$tachy_columns,
            thread.prefixid, thread.taglist, thread.hiddencount, thread.deletedcount, user.userid,
            user.membergroupids, user.infractiongroupids, user.usergroupid, user.homepage, user.options AS useroptions, IF(userlist.friend = 'yes', 1, 0) AS isfriend,
            user.lastactivity, user.lastvisit, IF(user.options & " 
$vbulletin->bf_misc_useroptions['invisible'] . ", 1, 0) AS invisible
            " 
. ($fetchavatar "
                ,avatar2.avatarpath AS api_avatarpath, NOT ISNULL(customavatar2.userid) AS api_hascustomavatar, customavatar2.dateline AS api_avatardateline, customavatar2.width AS api_avwidth, customavatar2.height AS api_avheight,
                user2.adminoptions AS api_adminoptions, user2.userid AS api_userid, user2.usergroupid AS api_usergroupid, user2.membergroupids AS api_membergroupids, user2.infractiongroupids AS api_infractiongroupids, user2.avatarrevision AS api_avatarrevision
            " 
"") . "
            " 
. (($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid']) ? ", NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed" "") . "
            " 
. ($deljoin ", deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason" "") . "
            " 
. (($vbulletin->userinfo['userid']) ? ", threadread.readtime AS threadread" "") . "
            " 
. ($redirectjoin ", threadredirect.expires" "") . "
            
$hook_query_fields
        FROM " 
TABLE_PREFIX "thread AS thread
            LEFT JOIN " 
TABLE_PREFIX "user AS user ON (user.userid = thread.lastposterid)
            LEFT JOIN " 
TABLE_PREFIX "userlist AS userlist ON (userlist.relationid = user.userid AND userlist.type = 'buddy' AND userlist.userid = " $vbulletin->userinfo['userid'] . ")
            " 
. ($fetchavatar "
                LEFT JOIN " 
TABLE_PREFIX "user AS user2 ON (thread.postuserid = user2.userid)
                LEFT JOIN " 
TABLE_PREFIX "avatar AS avatar2 ON(avatar2.avatarid = user2.avatarid)
                LEFT JOIN " 
TABLE_PREFIX "customavatar AS customavatar2 ON(customavatar2.userid = user2.userid)
            " 
"") . "
            
$deljoin
            " 
. (($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid']) ?  " LEFT JOIN " TABLE_PREFIX "subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = " $vbulletin->userinfo['userid'] . " AND canview = 1)" "") . "
            " 
. (($vbulletin->userinfo['userid']) ? " LEFT JOIN " TABLE_PREFIX "threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = " $vbulletin->userinfo['userid'] . ")" "") . "
            
$previewjoin
            
$tachyjoin
            
$redirectjoin
            
$hook_query_joins
        WHERE thread.threadid IN (0
$ids$hook_query_where
        ORDER BY thread.sticky DESC, 
$sqlsortfield $sqlsortorder. (!empty($sqlsortfield2) ? ", $sqlsortfield2 $sqlsortorder'') . "
    "
); 


MarkFL 10-22-2017 11:56 PM

It does appear that this plugin does not need to run except when a registered user is browsing the site, so I will update this product at the designated support sites. :)

djbaxter 10-23-2017 01:59 AM

Thank you, MarkFL.

Mike-D 08-13-2019 10:18 AM

Excellent work :up:

That's what I've been looking for a long time. Keep it up, Mark ;)


All times are GMT. The time now is 03:48 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01277 seconds
  • Memory Usage 1,774KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete