Saturday, September 5, 2015

Trick to increase Your Database performance speed. (2)

1. SELECT * is not always a bad thing, but it’s a good idea to         only move the data you really need to move and only when         you really need it, in order to avoid network, disk, and                 memory contention on your server.


2. Keep transactions as short as possible and never use them           unnecessarily. The longer a lock is held the more likely it is         that another user will be blocked. Never hold a transaction    open after control is passed back to the application – use             optimistic locking instead.


3. For small sets of data that are infrequently updated such as       lookup values, build a method of caching them in memory on     your application server rather than constantly querying             them in the database.


4. If doing processing within a transaction, leave the updates         until last if possible, to minimize the need for exclusive locks.


5.Cursors within SQL Server can cause severe performance          bottlenecks. Avoid them. The WHILE loop within SQL              Server is just as bad as a cursor.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home