Poor performance with SDE on SQL Server 2012

46034
105
08-20-2014 08:07 AM
AaronKreag
Deactivated User

We recently completed a major upgrade and migration.  Our SDE went from Windows 2008 with SQL Server 2008R2 and we migrated to Windows 2012 and SQL Server 2012 (all new is 64bit).  We have the exact same settings, using a better and newer server even, the data is the same, server and sql and sde configs all the same, direct connect all the way around on all servers.

However, we immediately noticed that the SDE on SQL 2012 is HORRIBLE.  The desktop editing process lags and hangs, its like working through Citrix in 1994.  The web map application load times went from 1-3 seconds to 10-40 seconds depending on load.

Same RAM, Same CPU.... the only difference is we went to SQL 2012.

There was a similar bug reported for 10.1 here NIM082657 - When working with an SQL Server 2012 geodatabase a..

It appears this isn't actually fixed.  If someone has any experience with this scenario please comment and reach out to me.  Thanks!!!  Aaron

Tags (3)
105 Replies
CostonCheatham
Deactivated User

Unfortunately, I can't.  My systems are on a closed network.  What I can tell you is that the query is the same as what you'd get by adding your feature class to ArcMap and doing something simple like panning.

Well, I guess the query is small enough to just enter by hand, so here goes:

select SHAPE, TYPE, <DB_NAME>.dbo.SDE_GEOMETRY203.CAD

from <DB_NAME>.dbo.<BusinessTable> LEFT JOIN <<DB_NAME>.dbo.SDE_GEOMETRY203 on <DB_NAME>.dbo.SDE_GEOMETRY203.GEOMETRY_ID = <DB_NAME>.dbo.<BusinessTable>.OBJECTID

WHERE <BusinessTable>.SHAPE.Filter(<Long Hex Number>) = 1

So there you have it.  The execution plan for this query on the prod server shows it doing a scan of the clustered index.  On the dev server, it makes use of the spatial index.  As I said before, if I drop the spatial and create it with a grid size of medium, it does use the spatial index.

And yes, I understand that the optimizer will choose what it thinks is the best index based on cost (taking into account statistics, etc.).  I just don't understand why it might do this for two identical systems, freshly loaded data and all.  I guess there has to be SOME difference there somewhere, but nothing terribly obvious.  I've checked SQL Server software versions, database versions (both 110), DB settings and so on.  The only thing I can think of that might be different is storage, but the optimizer shouldn't care about that.  If I was getting the same execution plan on both and one was performing horribly, I could then look at storage.

I suppose I can just adjust the keywords such that it always uses a medium gridsize.  I'm not too familiar with doing that.  Is there a good write-up on adding keyword/parameter values with some examples?

0 Kudos
CostonCheatham
Deactivated User

I forgot to add "Thanks for the reply" 

0 Kudos
nicogis
MVP Frequent Contributor

Have you updating statistics ?

0 Kudos
CostonCheatham
Deactivated User

Oh yeah, that was the first thing I did.

0 Kudos
nicogis
MVP Frequent Contributor

Have dev/test same number of core  http://sqlmag.com/sql-server/parallelism-sql-server-query-tuning

Query Optimizer could decide to use  parallel execution plan on a server with many cores
0 Kudos
CostonCheatham
Deactivated User

Hmmm... No, the prod server has more cores.  But the execution plan doesn't show anything about a parallel plan.  I suppose I could configure MAXDOP just as a test, eh?

0 Kudos
nicogis
MVP Frequent Contributor
0 Kudos
CostonCheatham
Deactivated User

I just thought that might work as a test.  We have the latest patches on both servers.

0 Kudos
nicogis
MVP Frequent Contributor

Yes, it fixes but I thought it was solved. In 2008r2 same problem https://www.sqlskills.com/blogs/bobb/does-everybody-get-that-spatial-index-reprise/ 

0 Kudos
CostonCheatham
Deactivated User

Just to let you know.  I did try it with MAXDOP set to 1 and it actually does work.  I rechecked the execution plan and the old plan actually did have parallelism listed.  When I set it to 1, it does not AND it uses the spatial index.  And...  the query returns in seconds.  YOU WERE RIGHT!!!

0 Kudos