Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Replication / July 2006

Tip: Looking for answers? Try searching our database.

Query  Optimisation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eckhart - 29 Jul 2006 08:45 GMT
DearAll,
I applied the modifications by implimenting the joins,created indexes
on relevent columns which are  acting as optimizer hints-result positve
improvement in the query processing,apart from that there is one more
issue thats supposed to be considered for code reusablity,
Eg: When on more service name comes into picture then the following
code(part of procedure) is supposed to modified [Eg new service name
QTEL]
select case servicename
when 'AKTEL' then 'Aktel'
when 'QATAR2900' then 'STAR MULTIMEDIA 2900'
when 'TELEMOVIL' then 'TeleMovil'
when 'COMCEL' THEN 'COMCEL'
when 'TSTTNEWS' then 'TSTT'
when 'TSTTWAP' then 'TSTT'
when 'TSTT_MMS' then 'TSTT MMS'
when 'ALCLICKWIN6464' then 'Airtel Click Win 646'
when 'ALMMSPORTAL' then 'Airtel MMS'
when 'ALMMSSMSDWN' then 'Airtel MMS SMS'
when 'ALMYALBUM646' then 'Airtel My Album'
when 'HINDU6397' then 'Hindu 6397'
So in such a situation can i go for a cursor instead of Select Case,I
fear cursor a lot 'cos of their severe appetite for memory- & slowing
down the dataprocessing & database server activity.
Also is it wise enough to use insert dml with a select  to load the
data of size greater than 100000 recs ? Can i use some thing like bcp
Regards
Eckhart
Paul Ibison - 31 Jul 2006 10:19 GMT
If it needs to be dynamic in the sense that the case statement will need
altering, I'd get rid of it and add all the pairs of values to a lookup
table. The main query will simply do a join onto the table to convert the
values. New values can easily be added to the lookup table without requiring
the code to change, and indexes can be used on the lookup table as well.
Cheers,
     Paul Ibison SQL Server MVP, www.replicationanswers.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.