Solved

Faster DB access

Posted on 2011-03-01
3
439 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now