Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

entity framework 4 - Microsoft SQL Server 2008 - 99% fragmentation on non-clustered, non-unique index -


i have table several indexes (defined below). 1 of indexes (ix_external_guid_3) has 99% fragmentation regardless of rebuilding/reorganizing index. have idea might cause this, or best way fix it?

we using entity framework 4.0 query this, ef queries on other indexed fields 10x faster on average external_guid_3 field, ado.net query same speed on both (though 2x slower ef query indexed fields).

table

  • id(pk, int, not null)
  • guid(uniqueidentifier, null, rowguid)
  • external_guid_1(uniqueidentifier, not null)
  • external_guid_2(uniqueidentifier, null)
  • state(varchar(32), null)
  • value(varchar(max), null)
  • infoset(xml(.), null) --> 2-4k
  • created_time(datetime, null)
  • updated_time(datetime, null)
  • external_guid_3(uniqueidentifier, not null)
  • fk_id(fk, int, null)
  • locking_guid(uniqueidentifer, null)
  • locked_time(datetime, null)
  • external_guid_4(uniqueidentifier, null)
  • corrected_time(datetime, null)
  • is_add(bit, not null) score(int, null)
  • row_version(timestamp, null)

indexes

  • pk_table(clustered)
  • ix_created_time(non-unique, non-clustered)
  • ix_external_guid_1(non-unique, non-clustered)
  • ix_guid(non-unique, non-clustered)
  • ix_external_guid_3(non-unique, non-clustered)
  • ix_state(non-unique, non-clustered)

note: sql server best practices state indexes less 10,000 pages not benefit performance gains.

see http://technet.microsoft.com/en-gb/library/cc966523.aspx http://technet.microsoft.com/en-us/magazine/2008.08.database.aspx?pr=blog

here's little snippet identify when db needs defragging.in our product, reduced 2000 , chose >20% fragmentation. can modify script tell indecies in particular.

select count(*) fragmented_indexes sys.dm_db_index_physical_stats(db_id(), null, null, null, null) p p.avg_fragment_size_in_pages <= 1 , p.avg_fragmentation_in_percent >= 20 , p.page_count > 2000; 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -