vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Debug Modes & Queries (https://vborg.vbsupport.ru/showthread.php?t=61730)

Aaron1 02-19-2004 08:32 PM

Yep, i was figuring out that myself ;-)

I think it's faster in a way, thanks Xenon! But i can't really tell the difference though, because the server load changes every second on my page.

Here's the current result:

---------------------------------------------------------------------
Query: SELECT count(*) AS posts FROM post INNER JOIN thread USING(threadid) WHERE post.dateline > 1077229208 AND thread.forumid NOT IN (16, 54)
Time before: 0.49642205238342
Time after: 0.50070309638977
---------------------------------------------------------------------

Xenon 02-19-2004 08:46 PM

that looks fast enough ;)

Aaron1 02-19-2004 08:50 PM

Enough?
I think you know better than that, because it's never ever fast enough.
And my sorry ass is depending completely on your scripting skills LOL ;-)

Xenon 02-19-2004 09:30 PM

*gg* well but 0.01 sec is ok ;)

Boofo 02-20-2004 12:22 AM

Quote:

Originally Posted by Xenon
Well, you can ignore the headers warning.

this will be on every explain=1 page.
Really nothing to worry about :)

As for the second query: well, you can set up an index for the dateline column of the post table, but apart from that there isn't much you can do.
joining the post and thread table is always slow ;)

maybe change the query into:
[sql]SELECT count(*) AS posts
FROM post
INNER JOIN thread USING(threadid)
WHERE post.dateline > '1077204189'
AND thread.forumid NOT IN (16, 54)[/sql]

it could speed up it a little bit.

How would you make this query also give you the amount of new threads since last visit along with the posts?

Xenon 02-21-2004 11:47 PM

[sql]SELECT count(postid) AS posts, count(DISTINCT threadid) AS threads
FROM post
INNER JOIN thread USING(threadid)
WHERE post.dateline > '1077204189'
AND thread.forumid NOT IN (16, 54)[/sql]

but it doesn't give you the new threads, just the UPDATED threads

Boofo 02-22-2004 12:03 AM

How would you get new threads started with that?

Xenon 02-22-2004 12:05 AM

well it's doable in one query, but it would reduce the speed of the query alot, so you better devide them up in two queries ;)

also don't use the above query if you do not want to restrict forums, as it's not nessesary for just getting the new posts ;)


All times are GMT. The time now is 10:53 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.01519 seconds
  • Memory Usage 1,727KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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