473,856 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best Practice Mysql Tables

Hi There,
I've got one table that is constantly being added to (every few
seconds). I've got a bunch of users that need to report from this
table. What's the best way to setup the tables? Create a second table
and updates it with tblLive data every let's say 15 minutes and then
report off of that? Is there a way to synch tables that doesn't have
a lot of over head? Or just report off of tblLive directly? Any
suggestions would be much appreciated.
Regards,
BP Dude Man

Nov 26 '05 #1
3 1706
On 26 Nov 2005 10:03:36 -0800, in mailing.databas e.mysql "BPDudeMan"
<bp*******@hotm ail.com> wrote:
| Hi There,
| I've got one table that is constantly being added to (every few
| seconds). I've got a bunch of users that need to report from this
| table.
What interface (web/desktop app) are you using to display the data?

How frequently does the user need to see this updated information?

What is the range of data required - minutes/hours/days/weeks/months?

Are you displaying raw data or converting to graphs or other display
items?

Do you require comparisons between date/time sets?
| What's the best way to setup the tables? Create a second table
| and updates it with tblLive data every let's say 15 minutes and then
| report off of that? Is there a way to synch tables that doesn't have
| a lot of over head? Or just report off of tblLive directly? Any
| suggestions would be much appreciated.
| Regards,
| BP Dude Man


I would do it the other way - archive your old data (more than 30 days
old) into another table.
---------------------------------------------------------------
jn******@yourpa ntsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Nov 27 '05 #2
>I've got one table that is constantly being added to (every few
seconds). I've got a bunch of users that need to report from this
table. What's the best way to setup the tables? Create a second table
and updates it with tblLive data every let's say 15 minutes and then
report off of that? Is there a way to synch tables that doesn't have
a lot of over head? Or just report off of tblLive directly? Any
suggestions would be much appreciated.


I'd suggest using the live table directly, if possible.
How serious is it if one of the additions to the table was delayed
for 10 seconds? Do you depend on the server to time-stamp the
entries or do they carry their own time stamps (or are time stamps
not needed)?

Which disrupts the data collection process less, assuming that
the reporting queries get a lock that prevents adding data:
running one of the reports, or grabbing 15 minutes of data (for
moving to a second table)?

How much of the (older) data do you need for one of the reports?

Gordon L. Burditt
Nov 27 '05 #3
BPDudeMan wrote:
Hi There,
I've got one table that is constantly being added to (every few
seconds). I've got a bunch of users that need to report from this
table. What's the best way to setup the tables? Create a second table
and updates it with tblLive data every let's say 15 minutes and then
report off of that? Is there a way to synch tables that doesn't have
a lot of over head? Or just report off of tblLive directly? Any
suggestions would be much appreciated.
Regards,
BP Dude Man


It depends on the nature of the reports. For example, if they
have to be consistent during the course of the day you should
create a report table once a day and use it for all reporting
purposes. If your users want/need more current information then
create a report table once per hour/half-hour/quarter-hour as
need be. BTW it is faster to drop and recreate the report table
rather than update it. Use syntax like:

CREATE reports_table AS SELECT * FROM live_table;

On the other hand, if by reports you really mean queries of the
live database table because "up-to-the-minute" information is
required by the users all reporting should use the live database
table.

The reporting requirements dictate how you should handle the
situation.
HTH

Jerry
Nov 27 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2030
by: John Pastrovick | last post by:
I am not sure what the most effective way to organize a db for users is. I have 40 users (teachers) and 20 tables (grades, assignments, students, etc). Each needs access to its OWN grades, assignemnts, etc. NOW I am not sure how to orgainize users in the DB. Right now I have the code for 1 user and need to adapt it to several users.
0
6375
by: John Hicks | last post by:
Is there an accepted best practice on whether to store decimal currency amounts (e.g. dollars and cents) in MySQL decimal column types? Certainly, the most straightforward way is to use decimal columns. But it appears that such values are stored as ASCII strings, which would be inefficient for calculations (requiring conversion to a numeric type for each calculation).
2
1575
by: John Pastrovick | last post by:
I am not sure what the most effective way to organize a db for users is. I have 40 users (teachers) and 20 tables (grades, assignments, students, etc). Each needs access to its OWN grades, assignemnts, etc. NOW I am not sure how to orgainize users in the DB. Right now I have the code for 1 user and need to adapt it to several users.
11
9295
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
4
2322
by: Will Hartung | last post by:
The designers have handed me a page that has 5 different blocks on it in the center column (in a typical 3 column layout with page spanning headers and footers). The blocks have elaborate headers (large images), and small content areas that will hold little blocks of text. Currently, I have this done with pixel specific tables within tables within tables, using the images as backgrounds of the repseective TD's.
10
1985
by: Rich Wallace | last post by:
Hey all, I have an XML doc that I read into a SQL Server database from an integration feed.... ----------------XML snippet ---------------- <?xml version="1.0" encoding="us-ascii"?> <!--Product data from JDEdwards--> <Root> <Root RvcDate="2004-02-03" RcvTime="14.16.03.795135">
17
8052
by: | last post by:
I have an app that retrieves data from an Access database. At the moment I have the SQL string as a Const in my app. I understand this is not best practice. I don't want the user to have access to read or modify this string so I don't want to store it in an INI / Text file or in registery. Can someone please tell me the best practice for this. Thanks Mike
5
2755
by: Ryan Liu | last post by:
I have an application need export ane import data of projects. There are about 10 database tables releated to one project. 3 of them each could have up to 100K lines data. I can export all data out into a xml file and then zip it. When I do import, I parse this xml file and then insert into database myself. Or I can export all tables out in csv format and then use mysql's client command "load local file" (which is claimed very fast...
51
3688
by: bigHairy | last post by:
Hello. I have been teaching myself .NET over the last few months and have had some success. I would like to ask a question though... A number of examples I have followed have the following in their finally statement Try ......
0
9904
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9758
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10772
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7086
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5754
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5956
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4169
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3195
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.