SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DOES COLLATE DATABASE_DEFAULT CAUSE PERFORMANCE ISSUES AND HOW DO I GET AROUND IT?


DOES COLLATE DATABASE_DEFAULT CAUSE PERFORMANCE ISSUES AND HOW DO I GET AROUND IT?

Author
Message
carolyn.foster
carolyn.foster
SSC Rookie
SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)

Group: General Forum Members
Points: 36 Visits: 20
I am updating an existing SP to point to a different database created outside of my control. Nearly every join in the code brings back a collation conflict error so I have changed the joins to COLLATE DATABASE_DEFAULT but now the code is running ridiculously slow and filling up TEMPDB - can you suggest any other way of resolving the conflicts?
ALZDBA
ALZDBA
SSC Guru
SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)

Group: General Forum Members
Points: 75415 Visits: 9244
it actually performs the collation translation, and materializes that data in tempdb, so .... yes.

The only decent way around it, is to create a new db and its object in the "common" collation and convert the data. Then reconnect your sp.
Contact the one who created the db outside of your control and as WHY !

Johan


Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere w00t

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
John Mitchell-245523
John Mitchell-245523
SSC Guru
SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)

Group: General Forum Members
Points: 85493 Visits: 18128
Several years ago I found a package on Codeplex, or somewhere like that, that allows you to change the collation of every single character column in the database. It handled foreign keys and indexes and things like that as well. I can't remember where the code came from now, but it may be worth your while searching for it.

John
Subramaniam Chandrasekar
Subramaniam Chandrasekar
SSC Eights!
SSC Eights! (886 reputation)SSC Eights! (886 reputation)SSC Eights! (886 reputation)SSC Eights! (886 reputation)SSC Eights! (886 reputation)SSC Eights! (886 reputation)SSC Eights! (886 reputation)SSC Eights! (886 reputation)

Group: General Forum Members
Points: 886 Visits: 348
carolyn.foster - Tuesday, January 30, 2018 7:31 AM
I am updating an existing SP to point to a different database created outside of my control. Nearly every join in the code brings back a collation conflict error so I have changed the joins to COLLATE DATABASE_DEFAULT but now the code is running ridiculously slow and filling up TEMPDB - can you suggest any other way of resolving the conflicts?

Yep, Collation could sometimes cause some misreads by the application. Due to this unnecessary table / index scans would happen which then result into performance issues. Also when working with different collations, any objects stored in the tempdb database can cause issues.

We can choose a collation which we can use when setting up SQL server, so that the same can be used for all your your databases and char columns. Again easier said than done...BigGrinBigGrinBigGrin

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search