Solved

Faster DB access

Posted on 2011-03-01
3
441 Views
Last Modified: 2012-05-11
Hello experts:

Have a table that has an identiy key starting at 1.
During processing we delete entries from this table and create
a file which is bulk inserted into this table at the end of processing.
This file contains the current posting date data.

Because records are added at the end of the table, the most current data
is posted at the end of the database. Clients use mostly the recent data
while rarely going back to search older records.  

The more records we add the slower the response time as far
as accesing the rows.

Question: As far as performance is concerned wouldn't it be better to delete
the identity key at the end of processing and sort the table by posting date desc
so that the current date is on top and then apply the identity key.
This way the records with the current posting date will have
an identity key starting at 1.

Also since records are deleted duiring procesing there will be gaps
in the identity key numbers. Does this cause perfomance issues?    

Thanks
0
Comment
Question by:lancerxe
3 Comments
 
LVL 25

Assisted Solution

by:reb73
reb73 earned 166 total points
ID: 35008371
Gaps in identity key does not necessarily cause a performance issue as such..

Just creating an index on the 'current posting date' should ensure that performance is acceptable.

If older data is not frequently used, it would make sense to move it to an archive table with the same structure + modified date to keep track of when records were moved to the archive table. You can always link both the tables using a view..
0
 
LVL 4

Accepted Solution

by:
MeLindaJohnson earned 167 total points
ID: 35009330
drop and create indexes
0
 
LVL 39

Assisted Solution

by:BrandonGalderisi
BrandonGalderisi earned 167 total points
ID: 35009768
You don't want to drop/create indexes.  But you may need to rebuild or update statistics.  It is best to look at the query plan and see why it is so slow.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question