ASP.NET optimize (Second, query optimization)

Second, query optimization (for sql server2000)

Many people write only for the purpose of sql statement, without taking into account the efficiency of sql statement. In this I can only provide a way of optimizing the order form, (sql statement of principles will be optimized and in my sql server2000 study notes in the symposium)

Sql statement on the efficiency of available sql server2000 query analyzer to see the implementation of the sentence.

Optimization of the order form: Under normal circumstances, sqlserver table will automatically make the connection optimization. For example: select name, no from A join B on A. id = B.id join C on C.id = A.id where name = 'wang'

A table in spite From the first list, and only then B, is the last C. But sql server may be the first to use c table. It is the choice of principle in relation to the query is restricted to a single or a few lines, you can reduce the other in the table to find the total amount of data. The vast majority of cases, sql server will make the best choice, but if you find a complex connection speed for the slower than expected, you can use SET FORCEPLAN mandatory sentence in accordance with the table sql server in order to use table. As patients with: SET FORCEPLAN ON……. SET FORCEPLAN OFF table of the implementation of the order will be written by you in accordance with the order of implementation. In the query analyzer to see two kinds of performance, thus linking the order of selection table.

* SET FORCEPLAN choose the order form link

3, page optimization (. Aspx)

Several pages for the main attribute

1, EnableViewState (page view state). If no special requirements set to false. The use of ViewState, each object must first sequence of the ViewState, and then returned through an anti-sequence, the use of ViewState is no price. To minimize the use of objects, if possible, to minimize Add to ViewState in the number of targets. Below is basically can disable viewstate:

(1) pages Control (. Ascx)

(2) do not back to their own pages.

(3) the need to control the incident.

(4) does not control or dynamic data binding attribute value (or for each postpack are dealt with in the code)

Every single page or pages are disabled ViewState, as follows: a single page: each page: web.config in EnableSessionState to keep the default (if the pages it will be used sessionstate occupied resources) . EnableViewStateMac If no security on the special requirements and maintain the default.

2, Pagelayout. Page layout model. Recommended Flowlayout (elements without absolute positioning attributes add). Gridlayout (absolute positioning attributes) due to absolute positioning, will produce more than Flowlayout the code, mainly controls the positioning information.

3, the project issued by the time bear in mind the lifting of pages Debug state.

4, Html language optimization. My proposal is to master Html / javascript, using less vs.net2003 automatic production code, it will automatically generate some useless html code.

5, smart navigation is set to true allows users to significantly improve the performance of the feeling. After the opening of this attribute to both client and server little influence on the new span it needs smart new span to be part of the new span.


View:(130)    comments:(0)
Nickname:
comments:


About esoftwarefactory.com |Sitemap |Newletter |Tags |Advertise
Partners: best dvd copy software
Copyright ©2008 Freeware shareware downloads - esoftwarefactory.com, All Rights Reserved