Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Making my SQL-query faster !
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Jóhannes
Junior Member

Iceland
139 Posts

Posted - 08 October 2003 :  10:50:13  Show Profile  Visit Jóhannes's Homepage  Send Jóhannes an AOL message
Im trying to make a front page, wich is suppose to show me 2 boxes (column in a table)
In box number one I want to show specific FORUMS (e.g. FORUM_ID=1, 12, 33)
In box number two I want to show next 3 events in the calander

This is working fine, but it takes 1,8 sec for the server to do this. Can I do this "faster"? (the slowest page in snitz takes 0,33 sec.) Is there anyone out there who is a SQL-expert? If so, here is my SQL. Please help me (am I doing something wrong in my SQL?). I have only one MOD, and that is Events Calendar



<%
Dim Year, Month, Day, ToDay
    Year = Year(now) 
    Month = Month(now) 
            if Month < 10 then
	    	Month = "0" & Month
	    end if    
    Day = Day(now) 
	    if Day < 10 then
    		Day = "0" & Day
	    end if    
    ToDay = Year & Month & Day & "0000"

Dim TengingSnitz, TengingBref
Dim SlodSnitz, SlodBref

'Path'
SlodSnitz = Server.MapPath("../xxxxxxxxxx/xxxxxxxxxx.mdb")

'Object'
Set TengingSnitz = server.createobject("adodb.connection")
				
'Open access'
TengingSnitz.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SlodSnitz 

'##### I want to show in one box on the front page FORUM_ID=50, 51, 52, 53, 55, 56, 57, 59, 63 and 72, the author and if there is a reply
Set GognSnitzGjoldSpjall = TengingSnitz.Execute("Select top 2 * From FORUM_TOPICS, FORUM_MEMBERS where T_AUTHOR=MEMBER_ID and (FORUM_ID = 50 or FORUM_ID = 51 or FORUM_ID = 52 or FORUM_ID = 53 or FORUM_ID = 55 or FORUM_ID = 56 or FORUM_ID = 57 or FORUM_ID = 59 or FORUM_ID = 63 or FORUM_ID = 72) Order by T_LAST_POST desc")

'##### And finaly next 3 events from the calendar in box number two on the front page
Set GognSnitzDagatalNaest = TengingSnitz.Execute("Select top 3 * From FORUM_TOPICS, FORUM_CAL_EVENTS, FORUM_FORUM where (FORUM_TOPICS.TOPIC_ID=FORUM_CAL_EVENTS.TOPIC_ID) and (FORUM_FORUM.FORUM_ID=FORUM_TOPICS.FORUM_ID) and (EVENT_DATE >= '"& ToDay &"') Order by EVENT_DATE ASC")
%> 

Jóhannes

puzo
Junior Member

Israel
417 Posts

Posted - 08 October 2003 :  10:54:05  Show Profile  Visit puzo's Homepage
i'd do it exactly the same, maybe your DB is big, maybe you need to delete old posts/ inactive users.


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 1.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07