vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Showing public poll results = damn slow? (https://vborg.vbsupport.ru/showthread.php?t=66689)

Andreas 06-29-2004 09:44 PM

Showing public poll results = damn slow?
 
It seems like displaying results of public posts on my board is damn slow.

Looking at the queries I found that for each option there is one query, which takes kinde long to execute.

Example:

Code:

                                SELECT user.userid,user.username
                                FROM pollvote AS pollvote, user AS user
                                WHERE user.userid = pollvote.userid AND
                                        pollid = '1832' AND
                                        voteoption = '1'
                                ORDER BY username ASC
                       
Time before: 0.42810201644897
Memory Before: 698KB
Time after: 0.87274694442749
Time taken: 0.44464492797852
Memory After: 698KB

Now let's say there are 10 options. Together with the time for the other queries and PHP processing this accumulates to 5+ seconds to generate the page!

Any idea as to why these queries are that slow and how this could be optimized (vB3)?

Xenon 06-29-2004 10:33 PM

Hmm, it isn't that slow on my testboard here, but i threw together a little optimization.

can you test it for me and post the results, i'll then release it in the optimization forum :)

(attachment can now be found: https://vborg.vbsupport.ru/showthread.php?t=66694)

Andreas 06-29-2004 10:50 PM

Although my code (which I wrote in the meanwhile) is slightly differnt it is basically the same as yours (without the USING part) :)

And this gave a HUGE performance boost: Page generation time went down approx. 5 seconds for the poll I tested.

Xenon 06-29-2004 10:52 PM

:)

perfect, then i can release it :)

Trigunflame 06-30-2004 12:43 AM

Bad mistake on part of the Vbulletin Dev's. Report it to the bugtracker if you already havn't.

Xenon 06-30-2004 03:10 PM

well, everyone can make a mistake :)

even so, a query in a loop is a real big mistake, but hey, noones perfect. i'm sure it will be fixed in vb302 ^^

Brad 06-30-2004 11:59 PM

Good bug find!


All times are GMT. The time now is 03:47 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.01014 seconds
  • Memory Usage 1,719KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete