Big performance problems with Vault 3.0.1

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Fri Jan 21, 2005 3:55 pm

Let's start at the beginning for checkout list security. Let's see how fast the current tree builds:

Code: Select all

SET STATISTICS TIME ON
SET STATISTICS IO ON 

DECLARE @@currenttxid bigint
SELECT @@currenttxid = currenttxid FROM sgvault.dbo.tblrepositories WHERE repid = 2
SELECT trf.treelevel, trf.fullpathhash, trf.parentpathhash, v.objid, v.objverid 
	FROM sgvault.dbo.ufngettreerevisionfolders(2, @@currenttxid) trf 
	INNER JOIN sgvault.dbo.tblfsobjectversions v ON (v.objverid = trf.objverid)

SET STATISTICS IO OFF
SET STATISTICS TIME OFF
GO
Again, I'm not interested in the results, just the message output.
Jeff Clausius
SourceGear

valik
Posts: 14
Joined: Wed Jan 19, 2005 11:33 am

Post by valik » Fri Jan 21, 2005 4:01 pm

jclausius wrote:Let's start at the beginning for checkout list security. Let's see how fast the current tree builds:

Code: Select all

SET STATISTICS TIME ON
SET STATISTICS IO ON 

DECLARE @@currenttxid bigint
SELECT @@currenttxid = currenttxid FROM sgvault.dbo.tblrepositories WHERE repid = 2
SELECT trf.treelevel, trf.fullpathhash, trf.parentpathhash, v.objid, v.objverid 
	FROM sgvault.dbo.ufngettreerevisionfolders(2, @@currenttxid) trf 
	INNER JOIN sgvault.dbo.tblfsobjectversions v ON (v.objverid = trf.objverid)

SET STATISTICS IO OFF
SET STATISTICS TIME OFF
GO
Again, I'm not interested in the results, just the message output.
Should I turn Folder Security again on before performing above statements?

Valik

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Fri Jan 21, 2005 4:07 pm

It doesn't matter for this query, since we are directly accessing the database.

However, it might not be a bad idea to turn it back on, so we don't forget later.
Jeff Clausius
SourceGear

valik
Posts: 14
Joined: Wed Jan 19, 2005 11:33 am

Post by valik » Fri Jan 21, 2005 4:12 pm

jclausius wrote:It doesn't matter for this query, since we are directly accessing the database.

However, it might not be a bad idea to turn it back on, so we don't forget later.
With Folder Security turned OFF:

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 35 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.
Table 'tblrepositories'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(5048 row(s) affected)

Table 'tblfsobjectversions'. Scan count 5048, logical reads 15182, physical reads 0, read-ahead reads 0.
Table '#23A4A887'. Scan count 1, logical reads 20, physical reads 0, read-ahead reads 0.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 249 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

With Folder Security turned ON:

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.
Table 'tblrepositories'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(5048 row(s) affected)

Table 'tblfsobjectversions'. Scan count 5048, logical reads 15182, physical reads 0, read-ahead reads 0.
Table '#7632E392'. Scan count 1, logical reads 20, physical reads 0, read-ahead reads 0.

SQL Server Execution Times:
CPU time = 16 ms, elapsed time = 302 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

Valik

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Fri Jan 21, 2005 4:55 pm

OK. Nothing there. Let's try the next phase of the procedure of getting locks:

Code: Select all

DECLARE @@repid_param [int], 
	@@userid_param [int], 

	@@currenttxid [bigint],
	@@rowsaffected [int], 

	@@treelevel [int], 
	@@leaflevel [int], 

	@@defaultrights [int], 
	@@listid [bigint]


DECLARE @@tmpsecurityrights TABLE 
(	objid [bigint] NOT NULL, 
	type [nchar](1) COLLATE DATABASE_DEFAULT NOT NULL, 
	securityrights [int] NOT NULL, 
	PRIMARY KEY (objid, type) 
)

CREATE TABLE #tbltreerevfolders 
(	treelevel [int] NOT NULL, 
	fullpathhash [binary](16) NOT NULL, 
	parentpathhash [binary](16) NOT NULL, 
	objid [bigint] NOT NULL, 
	objverid [bigint] NOT NULL, 
	securityrights [int] NOT NULL DEFAULT -1, 
	PRIMARY KEY (treelevel, fullpathhash, parentpathhash, objid) 
)

SELECT @@repid_param = 2,  -- Repository 2
	@@userid_param = 21 -- Valik's ID

SELECT @@currenttxid = currenttxid, @@listid = currentcolistid FROM sgvault.dbo.tblrepositories WHERE repid = @@repid_param

SET STATISTICS TIME ON

PRINT N'Getting Tree'
INSERT INTO #tbltreerevfolders (treelevel, fullpathhash, parentpathhash, objid, objverid) 
SELECT trf.treelevel, trf.fullpathhash, trf.parentpathhash, v.objid, v.objverid 
	FROM sgvault.dbo.ufngettreerevisionfolders(@@repid_param, @@currenttxid) trf 
	INNER JOIN sgvault.dbo.tblfsobjectversions v ON (v.objverid = trf.objverid)

PRINT N'Get Security Rights'
INSERT INTO @@tmpsecurityrights (objid, type, securityrights)
SELECT DISTINCT objid, type, securityrights + CASE WHEN ( type = N'U' ) THEN 100 ELSE 0 END FROM sgvault.dbo.ufngetusersecurityrights(@@repid_param, @@userid_param) 

PRINT N'Apply rights to tree'
UPDATE #tbltreerevfolders SET #tbltreerevfolders.securityrights = r.securityrights FROM @@tmpsecurityrights r 
	WHERE (#tbltreerevfolders.treelevel >= 0) AND (#tbltreerevfolders.objid = r.objid) 
IF ( @@ROWCOUNT > 0 )
BEGIN
	-- apply security settings down the tree (inherited rights)
	SET @@treelevel = 1
	SELECT @@leaflevel = MAX(treelevel) + 1 FROM #tbltreerevfolders WHERE (treelevel >= 0)
	WHILE ( @@treelevel < @@leaflevel )
	BEGIN 
		UPDATE trf SET trf.securityrights = tprev.securityrights FROM 
			#tbltreerevfolders trf INNER JOIN 
			#tbltreerevfolders tprev ON ((tprev.treelevel=(@@treelevel-1)) AND (tprev.fullpathhash=trf.parentpathhash) )
			WHERE (trf.treelevel = @@treelevel) AND (trf.securityrights < tprev.securityrights)
		SET @@treelevel = @@treelevel + 1
	END -- WHILE
	PRINT N'Finished applying rights'
END

PRINT N'Default Rights'
SELECT @@defaultrights = COALESCE(securityrights, 0) FROM @@tmpsecurityrights WHERE (objid = 0) AND (type = N'D')
UPDATE #tbltreerevfolders SET securityrights = CASE WHEN (securityrights = -1) THEN @@defaultrights ELSE (securityrights - 100) END WHERE (treelevel >= 0) AND ((securityrights = -1) OR (securityrights >= 100))

PRINT N'Join to get rights'
SELECT DISTINCT lf.objid, lf.hostname, lf.locktype, lf.folderobjid, lf.lockwhen, 
	lf.fullpath, lf.localpath, lf.comment, lf.miscinfo, lf.userid, lf.login, lf.objversion, lf.colistid 
	FROM #tbltreerevfolders trf INNER JOIN sgvault.dbo.tblfolderentries fe ON (fe.folderobjverid = trf.objverid), 
	sgvault.dbo.ufngetlockedfiles(@@repid_param, @@listid) lf INNER JOIN 
	sgvault.dbo.tblfsobjectversions v ON (v.objid = lf.objid) AND (v.objversion = lf.lastobjversion) 
	WHERE (trf.treelevel >= 0) AND (trf.securityrights <> 0) AND (fe.objverid = v.objverid) 

SET STATISTICS TIME OFF

DROP TABLE #tbltreerevfolders 
Jeff Clausius
SourceGear

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Fri Jan 21, 2005 5:01 pm

Valik:

I have some personal stuff that needs my attention. I'll be away for a while.

If you saw my last post, can you post the results? I'll check this out for any potential bottleneck later tonight.

Thanks,
Jeff Clausius
SourceGear

valik
Posts: 14
Joined: Wed Jan 19, 2005 11:33 am

Post by valik » Fri Jan 21, 2005 5:19 pm

jclausius wrote:Valik:

I have some personal stuff that needs my attention. I'll be away for a while.

If you saw my last post, can you post the results? I'll check this out for any potential bottleneck later tonight.

Thanks,
Jeff,

the results attached. I'm also going to sleep. It's quite late here in the Netherlands. Hopefully you have sometime later tonight I'll check tomorrow. We are getting everyday more complaints about the performance and there are also some issues with the IDE (Visual Studio 6 and Visual Studio .Net) and some other stuff but I think is beter to first improve the performance.

Valik
Attachments
jeff vault 2.txt
Second log for Jeff
(618.6 KiB) Downloaded 540 times

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Fri Jan 21, 2005 10:55 pm

Valik:

Sorry. I wasn't specific enough on my last post. Like the other queries, can you send me the messages output? At this point, the data is not important as the statistics from the query.

I should note from examining the data, I'd like to recommend to people to only check out files they think they will be modifying. Now, I haven't examined your I/O data from the query, so I'm not all that sure this is the problem. It was just something I wanted to bring to your attention.

The data looks like people are checking out more than what will be changed. The explanation for this follows - Currently, the Vault architecture deals with entire locked file lists for a repository. So when things are calculated, the entire lock list is used. Unfortunately, the more items are found in the checkout list the more processing time is required for working with the list. By only checking out a file that is intended to be modified, the list can be kept somewhat small.

Valik wrote:We are getting everyday more complaints about the performance and there are also some issues with the IDE (Visual Studio 6 and Visual Studio .Net) and some other stuff but I think is beter to first improve the performance.
It sounds like you're getting beat up from all sides. But, I agree with your assessment. Let's take these things one at a time. Once we determine what needs to be done to improve checkout list performance, we can start looking at other problems.

Unfortunately, I have some family engagements in the morning / afternoon. I should be able to take a look later in the evening. BTW, I'm GMT -6, so I think you should be about 6 or 7 hours ahead of me.
Jeff Clausius
SourceGear

valik
Posts: 14
Joined: Wed Jan 19, 2005 11:33 am

Post by valik » Sat Jan 22, 2005 6:43 am

jclausius wrote:Valik:

Sorry. I wasn't specific enough on my last post. Like the other queries, can you send me the messages output? At this point, the data is not important as the statistics from the query.

I should note from examining the data, I'd like to recommend to people to only check out files they think they will be modifying. Now, I haven't examined your I/O data from the query, so I'm not all that sure this is the problem. It was just something I wanted to bring to your attention.

The data looks like people are checking out more than what will be changed. The explanation for this follows - Currently, the Vault architecture deals with entire locked file lists for a repository. So when things are calculated, the entire lock list is used. Unfortunately, the more items are found in the checkout list the more processing time is required for working with the list. By only checking out a file that is intended to be modified, the list can be kept somewhat small.
I'll take this into account, but our experience with VSS in combination with SourceOffsite that it did not matter how many files where checkout. I would recommend this to be a improvement for a future release of Vault.

jclausius wrote:
Valik wrote:We are getting everyday more complaints about the performance and there are also some issues with the IDE (Visual Studio 6 and Visual Studio .Net) and some other stuff but I think is beter to first improve the performance.
It sounds like you're getting beat up from all sides. But, I agree with your assessment. Let's take these things one at a time. Once we determine what needs to be done to improve checkout list performance, we can start looking at other problems.
Yes we will do after this performance problem is solved
jclausius wrote:Unfortunately, I have some family engagements in the morning / afternoon. I should be able to take a look later in the evening. BTW, I'm GMT -6, so I think you should be about 6 or 7 hours ahead of me.
Here the results:


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.
Getting Tree

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(5048 row(s) affected)


SQL Server Execution Times:
CPU time = 78 ms, elapsed time = 127 ms.
Get Security Rights

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(10 row(s) affected)


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.
Apply rights to tree

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(9 row(s) affected)


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 3 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(4 row(s) affected)


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(11 row(s) affected)


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(101 row(s) affected)


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 1 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(211 row(s) affected)


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 3 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(383 row(s) affected)


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 6 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(614 row(s) affected)


SQL Server Execution Times:
CPU time = 10 ms, elapsed time = 10 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(813 row(s) affected)


SQL Server Execution Times:
CPU time = 14 ms, elapsed time = 14 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(1020 row(s) affected)


SQL Server Execution Times:
CPU time = 15 ms, elapsed time = 18 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(956 row(s) affected)


SQL Server Execution Times:
CPU time = 16 ms, elapsed time = 16 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(544 row(s) affected)


SQL Server Execution Times:
CPU time = 10 ms, elapsed time = 10 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(127 row(s) affected)


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 3 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(88 row(s) affected)


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 2 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(76 row(s) affected)


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 2 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(40 row(s) affected)


SQL Server Execution Times:
CPU time = 1 ms, elapsed time = 1 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(45 row(s) affected)


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 1 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(6 row(s) affected)


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.
Finished applying rights

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.
Default Rights

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(552 row(s) affected)


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 4 ms.
Join to get rights

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

(2654 row(s) affected)


SQL Server Execution Times:
CPU time = 79 ms, elapsed time = 14915 ms.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Sat Jan 22, 2005 2:05 pm

OK. This seemed to take 15 seconds. Is that correct?

What happens if you remove the last SQL Statement

Code: Select all

-- REMOVE THIS FROM THE ENTIRE QUERY - 
SELECT DISTINCT lf.objid, lf.hostname, lf.locktype, lf.folderobjid, lf.lockwhen,
   lf.fullpath, lf.localpath, lf.comment, lf.miscinfo, lf.userid, lf.login, lf.objversion, lf.colistid
   FROM #tbltreerevfolders trf INNER JOIN sgvault.dbo.tblfolderentries fe ON (fe.folderobjverid = trf.objverid),
   sgvault.dbo.ufngetlockedfiles(@@repid_param, @@listid) lf INNER JOIN
   sgvault.dbo.tblfsobjectversions v ON (v.objid = lf.objid) AND (v.objversion = lf.lastobjversion)
   WHERE (trf.treelevel >= 0) AND (trf.securityrights <> 0) AND (fe.objverid = v.objverid)
from the entire query. Does it still take 15 seconds? I'm hoping it does not. That means I'm reading the output correctly.
Last edited by jclausius on Sat Jan 22, 2005 2:17 pm, edited 1 time in total.
Jeff Clausius
SourceGear

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Sat Jan 22, 2005 2:08 pm

valik wrote:I would recommend this to be a improvement for a future release of Vault.
Yes, we already have this feature logged, but it will be a big change to the overall architecture, that it is hard to say when this would get implemented.
Jeff Clausius
SourceGear

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Sat Jan 22, 2005 2:15 pm

If the last statement is causing the 14-20 seconds, let's take a look at the execution plan for these statements:

1) Run - CREATE TABLE #tbltreerevfolders
( treelevel [int] NOT NULL,
fullpathhash [binary](16) NOT NULL,
parentpathhash [binary](16) NOT NULL,
objid [bigint] NOT NULL,
objverid [bigint] NOT NULL,
securityrights [int] NOT NULL DEFAULT -1,
PRIMARY KEY (treelevel, fullpathhash, parentpathhash, objid)
)

2) Run - SET SHOWPLAN_ALL ON

3) Run the query

4) Save / Paste the results ( as before )

5) Run - SET SHOWPLAN_ALL OFF

6) Run - DROP TABLE #tbltreerevfolders
Jeff Clausius
SourceGear

valik
Posts: 14
Joined: Wed Jan 19, 2005 11:33 am

Post by valik » Sat Jan 22, 2005 6:51 pm

jclausius wrote:OK. This seemed to take 15 seconds. Is that correct?

What happens if you remove the last SQL Statement

Code: Select all

-- REMOVE THIS FROM THE ENTIRE QUERY - 
SELECT DISTINCT lf.objid, lf.hostname, lf.locktype, lf.folderobjid, lf.lockwhen,
   lf.fullpath, lf.localpath, lf.comment, lf.miscinfo, lf.userid, lf.login, lf.objversion, lf.colistid
   FROM #tbltreerevfolders trf INNER JOIN sgvault.dbo.tblfolderentries fe ON (fe.folderobjverid = trf.objverid),
   sgvault.dbo.ufngetlockedfiles(@@repid_param, @@listid) lf INNER JOIN
   sgvault.dbo.tblfsobjectversions v ON (v.objid = lf.objid) AND (v.objversion = lf.lastobjversion)
   WHERE (trf.treelevel >= 0) AND (trf.securityrights <> 0) AND (fe.objverid = v.objverid)
from the entire query. Does it still take 15 seconds? I'm hoping it does not. That means I'm reading the output correctly.
If I remove the above mentioned statement then it takes less than one second otherwise it takes about 15 seconds.

Valik

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Sat Jan 22, 2005 9:25 pm

OK. Did you get a chance to run the queries w/ SHOWPLAN_ALL set to ON?

I'm going to look at this again to see if I can find a way to improve performance, but I'm going to need a day or two to hash things out. In the mean time, if you could get the execution plan, I can see if a modification to the query will improve things.

Thanks again,
Jeff Clausius
SourceGear

valik
Posts: 14
Joined: Wed Jan 19, 2005 11:33 am

Post by valik » Sun Jan 23, 2005 5:19 am

jclausius wrote:If the last statement is causing the 14-20 seconds, let's take a look at the execution plan for these statements:

1) Run - CREATE TABLE #tbltreerevfolders
( treelevel [int] NOT NULL,
fullpathhash [binary](16) NOT NULL,
parentpathhash [binary](16) NOT NULL,
objid [bigint] NOT NULL,
objverid [bigint] NOT NULL,
securityrights [int] NOT NULL DEFAULT -1,
PRIMARY KEY (treelevel, fullpathhash, parentpathhash, objid)
)
this statement is also in the query you mentioned before, do I have to run it separately?
jclausius wrote:2) Run - SET SHOWPLAN_ALL ON
OK
jclausius wrote:3) Run the query
Which query you mean, sorry I'm getting confused.
jclausius wrote:4) Save / Paste the results ( as before )
The result in the message output you mean?
jclausius wrote:5) Run - SET SHOWPLAN_ALL OFF
OK
jclausius wrote:6) Run - DROP TABLE #tbltreerevfolders
this statement is also in the query you mentioned before, do I have to run it separately?

Valik

Post Reply