Solved

Faster DB access

Posted on 2011-03-01
3
447 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

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 …
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

630 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