.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Asad Ali
Fauzul Azmi
Post New Web Links

Which index is better?

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :Sql Server
 

All things being equal, which is a better indexing strategy?

Scenario:

Fact table, 100 million rows of monthly data.  Approx. 1.5 million new rows per month.  Non partitioned.  Users query most recent month, 3 months or 12 months the most, then additional filters after that.  Table contains five years of history (60 months).  Reading data is more important to users that data inserts, which happen only monthly, and then just overnight.

Index strategy A:

Unique Clustered index on an identity key - Primary key constraint; non clustered indexes on other filtering columns, including the Date column

Index strategy B:

Non unique Clustered index on date column; primary key constraint on identity column; non clustered indexes on other filtering columns, first excluding date column, then trying with non clustered index on date column

---------------

Now, according to what I've "read", scenario B would be better performing for reads, whereas scenario A would be better performing for Inserts.  But when I set this up in a test environment, I am seeing the opposite effect in most cases.

When set up as scenario A, a select query filtering on date (where date >= 201004) it does an index scan and the IO stats and query times look good.

When set up as scenario B, with no non-clus


View Complete Post


More Related Resource Links

how to create index for a column

  

Hi Friends,

                       I need to create the index for a column and accessing that in sqlserver 2005. Please any one help me.



Thanks..,


Deleting items from the index (custom protocol handler)

  
I created a custom protocol handler. I successfully emit entries into the index. I just can't seem to delete them during an incremental crawl.

I tried:

1. no emitting child item during the enumeration of child entries in a folder
2. returning PRTH_E_OBJ_NOT_FOUND from CreateAccessorEx

doing either 1, 2, or both did nothing. The entries are still there.

what i need to do to delete these entries from the index during an incremental crawl?

Thanks.

Ingest google Search Index into Sharepoint 2007

  

Hi Folks

 I am wondering  if there is a way to ingest google search index into SharePoint index such that when people search via SharePoint they see the Google results too… incorporated/federated inline with the SP results (not as a separate "box" ).

We have Google search in our environment and also share-point search. Share-point search for sharepoint site but Google search is for all other environments. Now i am thinking if we ingest the Google search index into share-point then may be its great deal to provide user a platform to search everything on one place.

 

thanks

ws


i am at entry level administrator

Can't start crawl becasue of index move operation

  

Hi there,

I can't start crawl task. The log says that "Deleted by the gatherer (The start address or content source that contained this item was deleted and hence this item was deleted.)" But I did not change the path of content sources and When I trie to start crawling job it says "Crawling might be paused because a backup or an index move operation is in progress. Are you sure you want to resume this crawl?"

What is index move operation? What should I do? I'll really appreciate the solution greatly. Thanks in advance.

 


allan

"Content for this URL is excluded by the server because a no-index attribute." in crawl logs

  

Hi All,

I am getting following error message in Crawl Logs

" Content for this URL is excluded by the server because a no-index attribute. "

Any help in this regard will be greatly appreciated.

 

 


Contact Selector - Form tab index is lost after selector resolves names on blur

  

I'm working with an InfoPath2007 form developed to be filled-out through the browser on a SharePoint 2007 site, and I'm testing using Internet Explorer 7.  It's a straight-forward form, with a number of text fields and two Contact Selector controls.

The issue I'm encountering is with the Contact Selector control, where if the actor only enters a partial name into the text-field and then TABs away from the control the form will perform its auto-postback to look-up and resolve the partial name (showing the name resolution dialog is necessary), and afterward the actor's cursor is focused on the next field in the form.  The actor can type text into the focused field, but any subsequent pressing of the TAB key returns the actor's focus to the browser's ADDRESS bar, which is incorrect as it should proceed to the next field in the form.  I understand that the Contact Selector needs to perform its postback to perform the name resolution (so that there is no way through the InfoPath form designer to disable postbacks for the control), but why does the browser not know how to continue the TAB order of the fields on the form even when a field has focus?


QueryEx (Search) results and Custom Page Index

  

Hi All,

I done a web part which allow the user to query the search.asmx. It return the result fine against which I apply some xslt. However I need a mean to create a Page index. I only return the result based on a range defined in the query.

I need somehow to obtain the number of result the search is returning in total against what I only want to display on the screen.

The only way I sort of figure to do that is by first make a search just to obtain the number of result it will return in total and then make a search defining a range.

Has someone done something similar?

Seve


QueryEX results and Custom Page index

  

Hi All,

I done a web part which allow the user to query the search.asmx. It return the result fine against which I apply some xslt. However I need a mean to create a Page index. I only return the result based on a range defined in the query.

I need somehow to obtain the number of result the search is returning in total against what I only want to display on the screen.

The only way I sort of figure to do that is by first make a search just to obtain the number of result it will return in total and then make a search defining a range.

Has someone done something similar?

Seve


SharePoint Calendar Error: The "ListViewWebPart" Web Part appears to be causing a problem. Index was

  
In one specific SharePoint calendar, on one specific week in that calendar when we select the "more items" link in the monthly view (or the expand all option) we get the following error:
The "ListViewWebPart" Web Part appears to be causing a problem. Index was outside the bounds of the array.

Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator.
Troubleshoot issues with Windows SharePoint Services.

If we select a different week the expand and collapse works fine in that calendar.

Maintenance plan to rebuild Full-text index ? (SQL 2005)

  
Is it possible, through the GUI Wizard, to create a Maintenance plan that rebuilds (rather than reorganise/optimise) a Full text index in 2005 ? The full text index is based on one table only - so would using the "Rebuild index task" in the Wizard do the trick ? I wouldn't mind if the other indexes on the table were rebuilt too, but main concern in the Full text Index. If not - then I guess it would be a scheduled job which does a ALTER FULLTEXT CATALOG catalog_name REBUILD, but I thought it would be nice to keep it within the - Management - Maintenance plans - section of SQL Management Studio. Also - should this be preceeded with a transaction log backup ? Had some issues rebuilding them last night - seemed a Log backup was needed.

XML Index what for?

  
Hi, When you try to chose the a kind of index  to create a new index, you have four indexes types, namely The clustered index The non clustered index The XML index The Spacial index What the XML and Spacial indexes are used for?The complexity resides in the simplicity

SQL server index

  
Hi All, I am trying to understand some fundamentals in SQL server, I read that indexes (Set of pages) are arranged in B-Tree structure...and if it is a clustered index then we find the row of data at the leaf node or else a pointer to the data in case of a non-clustered index. Now my doubt is clustered index have the row at leaf level that means the entire table is available at the leaf nodes of the clustered index...then where are the non-clustered indexes leaf nodes pointing to  1) Are they pointing to the clustered indexes leaf node, as the rows are there. 2) If they are pointing to some other place then is this not duplicating the records (I do not think this is the case and am understanding things wrong..) Thanks in advance.. Bala

CPU killer when showing execution plan when having a missing index

  
Hi you all! Do you have problems with flickering and CPU getting high when you show the execution plan for a SQL Statement AND there is a missing index suggestion? See related connect id: https://connect.microsoft.com/SQLServer/feedback/details/360457/hovering-mouse-over-execution-plans-query-line-is-cpu-killer I really hope someone from Microsoft can take a look at this a give us a status update, over TWO years since I reported it and still an issue. Have you experienced the same? Please vote the bug up to "raise" the flag.Best regards Arild Røksund, Norwegian developer (SQL & .net), Omega AS (please Vote as helpful if helpful)

What is the meaning of Ascending\descending sort order of a column within an index

  
When I add a new index I can also specify the "sort order" as ascending or descending. What does it mean? does it affect performance? does it mean that the binary search tree will be set in a certain way?

SQL Query index

  
Hi, I am working on WM 6.0 MC75 device.  I am creating database using SQL compact server 3.0.  I have almost 30K records in device. When I execute simple query with Order BY it takes almost a minute to fetch data. Then I used index for where clause. It becomes fast and the time reduced to 7-8 sec.  But it creates problem in Insert/Update. As this takes ____ of time in inserting data to table. I dont know how to proceed further. As i stucked here. Please give ma a direction   Regards  Shruti

cannot create an index on a view

  
Hi All, Can I create an index on the following view? Create view myview with schemabidning as select id, date, value from tablea a right join (select id,min (date) as mindate, value from tablea ) b on a.id = b.id and a.date = b.mindate GO CREATE UNIQUE CLUSTERED INDEX IDX_1 ON MYVIEW(ID)     Right now i am getting an error.   Cannot create index on view "myview" because it references derived table "B" (defined by SELECT statement in FROM clause). Consider removing the reference to the derived table or not indexing the view. shamen

SQL Insert with Index Scan Problem....

  
Hi,   I'm having a very strange problem when inserting rows into a table. Let me try to explain a little better: Table1 (for example Book) with a lot of fields and one foreign key to Table2 (idVolume) and a primary key (identity - idBook). This table has a clustered index only on the primary Key. (this table has something like 10 Millions rows) Table2 (for example Volume) with a lot of fields and a primary key (idVolume) identity. (this table has hundreds of rows)   Now, the problem starts when I make a insertion on Table2. When I made an insertion, it was taking minutes to finish, so I stopped it. After looking into the execution plan of the query, there was something very very strange, there seems to be a clustered index scan on Table1... the problem is that since Table1 has so many rows, this index scan takes forever... Can anyone explain me why does the insertion on Table2 makes an clustered index scan on Table1? It really doesn't make any sense to me.   Thanks in advance. João Teixeira
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend