Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 17th, 2011, 10:49 AM
JohnnyKY JohnnyKY is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Location: Louisville, Kentucky U.S.
Posts: 58 JohnnyKY User rank is Sergeant Major (2000 - 5000 Reputation Level)JohnnyKY User rank is Sergeant Major (2000 - 5000 Reputation Level)JohnnyKY User rank is Sergeant Major (2000 - 5000 Reputation Level)JohnnyKY User rank is Sergeant Major (2000 - 5000 Reputation Level)JohnnyKY User rank is Sergeant Major (2000 - 5000 Reputation Level)JohnnyKY User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 17 h 8 m 19 sec
Reputation Power: 27
Website Statistics Query

What is the best method for saving large amounts of data such as site stats without bogging down the system by joining such a massive table?

I figured I should avoid doing UPDATE queries to avoid table locking for speed purposes but I have created the other problem for the report side of things. When I join the table of millions of rows it tends to timeout. I do have indexes and such but the query is so complex.

I was thinking about continuing mass INSERT SELECTS to save data, but instead of joining the table when fetching stats I will have another table that holds counts. I do this with a view but that as you know is just a query. If I switch it to another table that holds the counts and populate this table with a cron job would this solve my problem? is there a better solution? Also would it be better to write to the server instead of a table?

Reply With Quote
  #2  
Old June 17th, 2011, 03:11 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,369 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 6 h 14 m 57 sec
Reputation Power: 4140
you've asked a bunch of questions but you haven't told us what your tables look like, or where the updates are coming from

in fact, we don't have enough information even to determine whether you're doing updates or inserts
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Website Statistics Query

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap