Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Faster DB access

Posted on 2011-03-01
3
Medium Priority
?
452 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 664 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 668 total points
ID: 35009330
drop and create indexes
0
 
LVL 39

Assisted Solution

by:BrandonGalderisi
BrandonGalderisi earned 668 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

916 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