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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS SQL Server
 Access to MSQL performance issues !
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 7

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 02 October 2005 :  14:34:06  Show Profile
Run the Profiler ? I have never heard about this before, what and where is it?
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 02 October 2005 :  14:55:44  Show Profile  Send ruirib a Yahoo! Message
It's in the same menu as the other SQL tools.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 03 October 2005 :  01:58:12  Show Profile
Oh, you are talking about the Enterprise Manager !? Ok, Iīll take a look at the Profiler.
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 03 October 2005 :  06:07:03  Show Profile
Is it the index tuning wizard ? Seems like I canīt access that, only my host can.
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 03 October 2005 :  06:10:49  Show Profile  Send pdrg a Yahoo! Message
Try using Query Analysewr (isql.exe) and looking at the estimated execution plan - if you see 'table scan' coming up, you can almost certainly get a boost from indexing - let me know what it says :)

hth
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 03 October 2005 :  06:14:33  Show Profile
Hmm, the Query Analyzer is empty - where do I look?
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 03 October 2005 :  06:57:09  Show Profile  Send ruirib a Yahoo! Message
From the Query Menu, choose Show Execution Plan, execute the query and have a look at the Execution plan tab, at the bottom.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 03 October 2005 :  15:53:30  Show Profile
But I need a query to execute before I see anything, right?

God, Iīm really lost in this Enterprise Manager.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 03 October 2005 :  16:15:46  Show Profile  Send ruirib a Yahoo! Message
Yeah, that's why the profiler could be helpful, no query needed. You can try to output the SQL for query that retrieves the replies, in topic.asp, paste it into query analizer and then check it for improvements, as pdrg suggested.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 03 October 2005 :  16:25:15  Show Profile
I asked my host to look at this topic, weīll see what happens.
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 04 October 2005 :  04:47:27  Show Profile  Send pdrg a Yahoo! Message
wii - if you've got 'Query Analyser' (which you do have!) then just pick out the SQL related to that particular table and paste it in query analyser - then you do NOT have to execute it, just 'show estimated execution plan' - it asks the dbengine how it would attempt to run that SQL and brings back a pretty picture of the execution plan. Once you've got the pretty picture (with lots of arrows on it) we can look at that to see if you need extra indexing, all without running the profiler :)

look in 'Books Online' (sqlbol.chm) for 'Graphically Displaying the Execution Plan Using SQL Query Analyzer' - we can then help you look at the elements to see what needs tweaking :)

hth
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 04 October 2005 :  06:25:53  Show Profile
Ok, I got an answer from my host - which I will try to translate here:

-------------

I have tried to look into the calls that takes the longest for the SQL server to perform, it seems like itīs a script called stored procedures.

I have attached one of these calls:

declare @P1 int
set @P1=180150000
declare @P2 int
set @P2=8
declare @P3 int
set @P3=1
declare @P4 int
set @P4=15262
exec sp_cursoropen @P1 output, N'SELECT M.M_NAME, M.M_RECEIVE_EMAIL, M.M_PMRECEIVE, M.M_AIM, M.M_ICQ, M.M_MSN, M.M_YAHOO, M.M_TITLE, M.MEMBER_ID, M.M_HOMEPAGE, M.M_LEVEL, M.M_POSTS, M.M_COUNTRY, M.M_DATE, R.REPLY_ID, R.FORUM_ID, R.R_AUTHOR, R.TOPIC_ID, R.R_MESSAGE, R.R_LAST_EDIT, R.R_LAST_EDITBY, R.R_SIG, R.R_STATUS, R.R_DATE, R.R_MSGICON, M.M_SIG, M.M_Avatar, M.M_AVATAR_WIDTH, M.M_AVATAR_HEIGHT FROM FORUM_MEMBERS M, FORUM_REPLY R WHERE M.MEMBER_ID = R.R_AUTHOR AND R.TOPIC_ID = 1675 AND (R.R_STATUS < 3 OR R.R_AUTHOR = 153) ORDER BY R.R_DATE ASC', @P2 output, @P3 output, @P4 output
select @P1, @P2, @P3, @P4


When I try to run the call, it takes about 3 seconds in the Query Analyzer, if I try to update the site, it takes about 3-5 seconds.

By pressing CTRL+K in the Query Analyser I could retrieve an Execution Plan (which I also attached:)



I have tried to create 2 indexes for the table FORUM_REPLY by rightclicking the table and choose Design Table, then rightclick and choose Indexes/Keys.

The 2 indexed I created are called IX_FORUM_REPLY_test og IX_FORUM_REPLY_test2

Unfortunately, this didnīt help much on the time, so I tried to create a relation between FORUM_MEMBERS and FORUM_REPLY, this can be seen under the folder Relationships

This relation is called FK_FORUM_REPLY_FORUM_MEMBERS.

I couldnīt get any significant speed improvement on the forum, but I hope to give you a little more to work with.

Edited by - wii on 04 October 2005 06:28:35
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 04 October 2005 :  07:20:31  Show Profile  Send pdrg a Yahoo! Message
Hmmm adding an index would speed up the select but slow down the insert, typically, but as it's making no difference I'm not sure where to turn. You're trying all the obvious places - what fields did you build the indexes on?

The table scans may not be making that big a difference if they're clustered on ID, I suppose, so that may be a red herring - maybe the overall server load is high.

I'm not familiar with sp_cursoropen, but cursors are notoriously clumsy and clunky. Maybe someone more familar with the Snitz sprocs can comment further...I'm in meetings for the rest of the day now, I'll look back in tomorrow and see if I can think of anything in the meantime!
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 04 October 2005 :  07:27:31  Show Profile
The above is from my host, as I have no idea what to do.

I donīt think the server load is high, it just got MSSQL installed locally on my request, so I maybe the only one using it currently, I can ask my host about that, but as everything else on the forum is really fast, I tend to think itīs something in the Snitz code.

Does anyone else here have very long topics (over 300-400 pages) running on MSSQL, so I can compare speeds?
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 04 October 2005 :  07:34:40  Show Profile
I found this, which could be interesting:

http://www.sqlteam.com/item.asp?ItemID=6891
Go to Top of Page
Page: of 7 Previous Topic Topic Next Topic  
Previous Page | Next Page
 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 0.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07