Web Wiz - Green Windows Web Hosting - Celebrating 25 Years!

  New Posts New Posts RSS Feed - 8beta2 Appreciable decline of productivity
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

8beta2 Appreciable decline of productivity

 Post Reply Post Reply Page  <1234>
Author
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2006 at 9:55am
I have been working on this to try and find a solution.

I did speed things up slightly by using 3 more efficient quires, but I don't like the extra database hits.

I'll do some testing with the 3 various solutions, and yours this morning and see what offers the best performance.

Many thanks, I'll let you know how the testing goes.
Back to Top
DeadMeat View Drop Down
Newbie
Newbie
Avatar

Joined: 24 January 2006
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote DeadMeat Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2006 at 1:31pm
Hi Borg
 
Just glad I could help in some way. Let me know what the outcome is of your testing, as i am very interested. If you have some other SQL statements that you would like to to look at to help sort out, then just let me know and I will gladly give a helping hand.
 
Thanks
DM
Back to Top
Ritchie View Drop Down
Groupie
Groupie
Avatar

Joined: 14 June 2005
Location: Russian Federation
Status: Offline
Points: 91
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ritchie Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2006 at 2:27pm
Это круто! Borg лучший! Excellent work! Clap Speed of generation of head page of your forum has grown in some timesThumbs Up! At me a small question on productivity forum_topics.asp. I have noticed, that very strongly speed of generation decreases in themes which have a plenty of pages.
 
 
At quantity such topics 10-15 on one page speed of generation of page can be 0,9 - 2 seconds! Ouch(I tested on 2 x P4 3.0 GGz 2Gb RAM) whether variants of optimization of a code Are possible?
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2006 at 2:29pm
I found a slight problem with your SQL, that if no-one had a Birthday on that day it wouldn't return the number of members as well, and as I also need to get the last member registered I had to alter the SQL a bit and came up with:-

strSQL = "SELECT " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.DOB, " & _
    "(SELECT COUNT (*) FROM "  & strDbTable & "Author WHERE 1=1) AS memberCount " & _
"FROM " & strDbTable & "Author" & strDBNoLock & " " & _
"WHERE tblAuthor.Author_ID = " & _
    "(SELECT " & strDBTop1 & " " & strDbTable & "Author.Author_ID " & _
    "FROM " & strDbTable & "Author" & strDBNoLock & " " & _
    "ORDER BY " & strDbTable & "Author.Author_ID DESC " & strDBLimit1 & ") " & _
"OR (MONTH(" & strDbTable & "Author.DOB) = " & Month(dtmNow) & " AND DAY(" & strDbTable & "Author.DOB) = " & Day(dtmNow) & ") " & _
"ORDER BY " & strDbTable & "Author.Author_ID DESC;"


However, due to the sub queries that was required I found it slowed the query down some what.

The fastest SQL I have at the moment is 3 SQL queries:-

Query for Birthdays:-

strSQL = "SELECT " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.DOB " & _
    "FROM " & strDbTable & "Author" & strDBNoLock & " " & _
    "WHERE (MONTH(" & strDbTable & "Author.DOB) = " & Month(dtmNow) & " "
        "AND DAY(" & strDbTable & "Author.DOB) = " & Day(dtmNow) & " " & _
        "AND tblAuthor.DOB IS NOT NULL " & _
        "AND tblAuthor.DOB <> '') " & _
    "ORDER BY " & strDbTable & "Author.Author_ID DESC;"

Query for last member:-

strSQL = "SELECT " & strDBTop1 & " " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID " & _
"FROM " & strDbTable & "Author" & strDBNoLock & " " & _
"ORDER BY " & strDbTable & "Author.Author_ID DESC " & strDBLimit1 & ";"


Query for member count:-

strSQL = "SELECT Count(tblAuthor.Author_ID) AS memberCount " & _
"FROM tblAuthor" & strDBNoLock & " " & _
"ORDER BY Count(tblAuthor.Author_ID);"

Back to Top
DeadMeat View Drop Down
Newbie
Newbie
Avatar

Joined: 24 January 2006
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote DeadMeat Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2006 at 2:37pm
Hi Borg
 
I see what you mean, to be honest I think the best you are going to get is 2 queries, I would merge the last 2 queries (Query for last member and Query for last member) together so that they are one, and then at least you will only have 2 queries instead of 3, and as you are only looking for the TOP1 in the second query it should be slightly faster than 2.
 
Thanks
DM
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2006 at 2:38pm
Originally posted by Ritchie Ritchie wrote:

Это круто! Borg лучший! Excellent work! Clap Speed of generation of head page of your forum has grown in some timesThumbs Up! At me a small question on productivity forum_topics.asp. I have noticed, that very strongly speed of generation decreases in themes which have a plenty of pages.
 
 
At quantity such topics 10-15 on one page speed of generation of page can be 0,9 - 2 seconds! Ouch(I tested on 2 x P4 3.0 GGz 2Gb RAM) whether variants of optimization of a code Are possible?


I have gone through the page and even read an entire book on SQL performance tuning to try and get some tips to get the SQL to perform at higher speed, but the problem is the amount of joins needed in the SQL on that page in order to get all the required data.

I even tried different join techniques, but found the old pre SQL 99 join technique the fastest in tests.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2006 at 2:42pm
Originally posted by DeadMeat DeadMeat wrote:

Hi Borg
 
I see what you mean, to be honest I think the best you are going to get is 2 queries, I would merge the last 2 queries (Query for last member and Query for last member) together so that they are one, and then at least you will only have 2 queries instead of 3, and as you are only looking for the TOP1 in the second query it should be slightly faster than 2.
 
Thanks
DM

I've done as you suggested and the speed remains the same, but at least there is one less database hit.

Also you can disable the displaying of Birthdays, so that should increase performance for those who don't want that feature.

Thanks for your suggestions it's certainly helped.

Now just need to speed up the performance on the forum_topics.asp page
Back to Top
DeadMeat View Drop Down
Newbie
Newbie
Avatar

Joined: 24 January 2006
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote DeadMeat Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2006 at 2:45pm
Hi Borg
 
Well if you need help there, let me know where you think the problem is, and I will have a look for you, is it in the SQL or the page itself?
 
I will have a dig around and see what I can find, but some clues would be really great.
 
Thanks
DM
Back to Top
 Post Reply Post Reply Page  <1234>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.