Professional Documents
Culture Documents
27/06/2016
Chandra Sekhar
Mohd Sayeed Akthar
Agenda
2
SQL client parameters
The Driver is the network
ODBC/JDBC
4
Managing connections - Connection Retry Count
Retry??
DB How many
times??
5
Query Timeout
- Query Timeouts
SELECT * FROM Application
Pub.vBigTable
ODBC
SELECT * FROM
Pub.vBigTable
How much can I wait
for one query
SQL Server execution??
DB
6
Managing Availability - Alternate Servers
- Failover Mode
Client Client Client
- Failover Granularity
- Failover Preconnect
- Load balancing
SQL SQL SQL
DB DB DB
7
Security configurations -EncryptionMethod
SQL - CryptoProtocolVersion
Client
SELECT * FROM XY&*X#$
CUSTOMER - ValidateServerCertificate
*(KNJ$(#$
- HostNameInCertificate
$ @ % A A A A
& ! ! ^ D D D D
encryption method same
* @ $ #
SQL Server E E E E
8
Network Using more efficiently - Fetch Array Size
SQL
Client
SQL Server
A
B
A
B
A
B
A
B
What should I configure??
C C C C
D D D D
E E E E
9
Handling with different code pages IANAAppCodePage=18
ODBC {, , }
DB
10
SQL specific broker parameters
All about Locks
What should I
configure???
Transaction T1 Transaction T2
SQLLockWaitTimeout
Res-A Res-B
Transaction T1 Transaction T2
TRANSACTION
ISOLATION LEVEL
Res-A Res-B
SET TRANSACTION ISOLATION
NO LOCK
LEVEL READ UNCOMMITTED
Locks
SELECT CustNum, Name from
LOCK TABLE Pub.Customer
Pub.Customer Where IN
Transaction Management EXCLUSIVE
City=Bedford MODE;
(NOLOCK)
13
ABL inserted more
SQLTruncateTooLarge
SQL: ahh, I can see you (California)
SQL: I can see but partially (Califor)!! SQLWidthUpdate
SQL: I cannot understand you!!
ABL: I Can see (California)!! How should I
SQL ABL configure???
O Statements
Cache
O SQL
O
DB
15
Temporary tables, buffers - configurations
-SQLTempBuff
-T
-t
O Temporary Tables
buffer
O SQL
Select CustNum, Count(OrderNum)
O
From Pub.Order Group By
CustNum Order By Custnum
Sorting
DB
Temp
DB
Aggregation
Temp. Result Set
16
Configuring Stack size
Local Data
Return 3 Default - 1MB -SQLStack
Local Data
O How big it
Return 2
SQL O should be???
O Local Data
Return 1
DB Local Data
Return 0
17
SQL Server Tuning
Optimizer and Statistics
Statistics
SELECT * FROM Customer, Order WHERE
Customer.CustNum=Order.CustNum
Join Join
DB
19
What to look for
UPDATE STATISTICS;
Statistics
UPDATE TABLE STATISTICS AND
INDEX STATISTICS AND
COLUMN STATISTICS FOR Customer; How often I
should update?
Table Column
_SysTblStat _SysColStat
Index
_SysIdxStat
20
Is it good to create many indexes?
21
SQL Hints
NOEXECUTE
SELECT CustNum, Name from Pub.Customer Where City=Bedford NOEXECUTE;
NO REORDER
SELECT CustNum,OrderNum from
Pub.Customer c, Pub.Order o {NO REORDER}
Where c.custNum = o.CustNum
FORCE INDEX
SELECT CustNum,Name from Pub.Customer FORCE ( INDEX (IDX_NAME))
22
Questions?