Database Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesDatabase Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old November 1st, 2007, 01:42 AM
ankitmathur ankitmathur is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 3 ankitmathur User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 18 sec
Reputation Power: 0
Exclamation How to increase table response time

Hi,

I've a table with about 15,379,759 records in the past six months.

I only maintain a data of about last six months in this table & move earlier part to another table.

Now with a growing database this table too increasing manifold & its getting very time-consuming to retrieve a few set of records say a week-wise consolidated data for last one month as the query has to go all the way up & down several times.

So I wanted to know a better way to organize this table. I don't want to break the table into too many parts.

Any suggestions would be welcome either to somehow improve table response time or, ways to improve query or, design modification or, any other method.



Thanks

Ankit Mathur

Reply With Quote
  #2  
Old November 1st, 2007, 06:41 AM
Humanetainit's Avatar
Humanetainit Humanetainit is offline
Beyond help
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Location: The Netherlands
Posts: 223 Humanetainit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 1 h 32 m 30 sec
Reputation Power: 2
Do you use any indexes?
__________________
One World... Humanetainit | Program secure

Reply With Quote
  #3  
Old November 1st, 2007, 07:05 AM
ankitmathur ankitmathur is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 3 ankitmathur User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 18 sec
Reputation Power: 0
Exclamation No index is being used

Quote:
Originally Posted by Humanetainit
Do you use any indexes?


Hi,

As of now NO I don't use any index on this table & I intend to make a index based on Datetime field

However, I know for sure an index only by itself won't be able to satisfy my requirements.

So I wanted some other modes also.

Reply With Quote
  #4  
Old November 1st, 2007, 07:21 AM
Humanetainit's Avatar
Humanetainit Humanetainit is offline
Beyond help
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Location: The Netherlands
Posts: 223 Humanetainit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 1 h 32 m 30 sec
Reputation Power: 2
What is your table structure? What fields do you use for your select?

Reply With Quote
  #5  
Old November 2nd, 2007, 02:13 AM
ankitmathur ankitmathur is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 3 ankitmathur User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 18 sec
Reputation Power: 0
Exclamation AccountId, StartDatetime & ToDatetime are the required parameters mostly

Quote:
Originally Posted by Humanetainit
What is your table structure? What fields do you use for your select?


I have a nonclustered, unique, primary key located on PRIMARY ID

Mostly the parameters in where clause would call for AccountId, StartDatetime & ToDatetime.

May I also add that this is already an archive table. whereby everday last day's entry from the main table is inserted so as to enable us to maintain a decent performance for the live data from main table. Any data that has to be accessed later than a day would require me to come to this table.

Another thing I'd like to add is that I don't only require this table for fetching month wise reports.

Even single record may have to be taken out based on classification parameters. Its actually maintaining all the call records for a user.

So user specific call record on a date are also used.


So I wanted to know a better way to organize this table. I don't want to break the table into too many parts.

Any suggestions would be welcome either to somehow improve table response time or, ways to improve query or, design modification or, any other method.


I hope I've provided sufficent information and am hoping that somebody could guide me towards a proper way to increase the table's response time.

Ankit Mathur

Reply With Quote
  #6  
Old November 2nd, 2007, 02:41 AM
Humanetainit's Avatar
Humanetainit Humanetainit is offline
Beyond help
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Location: The Netherlands
Posts: 223 Humanetainit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 1 h 32 m 30 sec
Reputation Power: 2
My bet would be that AccountId, StartDatetime & ToDatetime all need indexes; and preferably be kept out of the way of large amounts of data.

Is it an option to create a new table with AccountId, StartDatetime & ToDatetime and a second one with AccountId and the rest of your columns?

All your selects would be on a smaller table, and you could use a join to fetch the rest of the data.

Since it's an archive table, a couple of extra indexes won't hurt too much; inserts might be slower, but that's probably a price you're willing to pay.

Reply With Quote
  #7  
Old November 7th, 2007, 05:26 AM
sinha.techie sinha.techie is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 7 sinha.techie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 40 m 33 sec
Reputation Power: 0
If you , compare some strings in your query ,
You can check for fulltextsearch ........

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesDatabase Development > How to increase table response time


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway