473,386 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

performance question

Hi all,

I have 2 questions regarding performance:

1) I'm building a monitoring system that has to store lots of sensor
data that I 'll have to query from time to time. I have pressure and
temperature. Since we sample every 500 ms we will get lots of data
after some time. Will my performance increase by making 2 tables; one
with pressure and one with temperature? Thus when querying (eg
pressure) mysql will only need to look in the pressure table that
contains half the data opposed to when querying a table that contains
pressure and temperature (and is double the size)?

2) I have read that when querying the server in read mode opposed to
read/write mode you can get a performance increase. Can this be done
with php?

Many thanks in advance
Stijn

Apr 13 '06 #1
4 1658
ta******@gmail.com wrote:
Will my performance increase by making 2 tables; one
with pressure and one with temperature?
I doubt it. Besides, I assume it would often be the case that you'd
want both figures, so you'd eliminate any potential gains anyway when
you join the two tables.

It sounds like you're going to be producing 2 records per second. Even
after a year of continuous measurement 24 hours per day, you'll have 63
million records. This may be reaching the upper bounds of what MySQL is
best suited for, but it can handle it. If you use indexes properly,
queries won't be too slow (certainly slower than after 1 day of
measurements, but that's to be expected).

There is a chapter in the MySQL docs about improving performance.
http://dev.mysql.com/doc/refman/5.0/...imization.html

There are also several articles on the MySQL web site in the "white
papers" section on achieving even greater scalability (larger databases,
faster performance) with other features of the product, like clustering
and partitioning. http://www.mysql.com/why-mysql/white-papers/

There are many companies using MySQL for high volume applications. See
http://www.mysql.com/why-mysql/case-studies/.
2) I have read that when querying the server in read mode opposed to
read/write mode you can get a performance increase. Can this be done
with php?


I have not heard of a feature called "read mode". Can you cite a reference?

You may be thinking of the REPEATABLE READ transaction isolation mode.
This doesn't increase performance, but reduces the likelihood that two
concurrent queries will block one another.

Regards,
Bill K.
Apr 13 '06 #2
>1) I'm building a monitoring system that has to store lots of sensor
data that I 'll have to query from time to time. I have pressure and
temperature. Since we sample every 500 ms we will get lots of data
after some time. Will my performance increase by making 2 tables; one
with pressure and one with temperature? Thus when querying (eg
pressure) mysql will only need to look in the pressure table that
contains half the data opposed to when querying a table that contains
pressure and temperature (and is double the size)?
Double the size? Surely you're storing something other than
temperature and pressure in the table, like date, time, which
temperature/pressure sensor, etc. Assuming you always take temperature
and pressure readings together and put them in the same table, the
other info wouldn't have to be duplicated.

If the temperature and pressure readings need DIFFERENT time stamps
(a single one for both isn't sufficiently accurate) you probably
want separate tables.

Do your queries often need pressure alone, or do they often want
temperature and pressure together?

At this rate of data generation, you should worry not only about
the QUERIES, but the data insertion as well. Using two tables means
maintaining two indexes of the data. More indexes => faster reading
data but slower inserting it.
2) I have read that when querying the server in read mode opposed to
read/write mode you can get a performance increase. Can this be done
with php?


What is "querying in read mode"?

It is often true that reading a single record is faster than inserting
a single record (due to locking contention and updating indexes) but
two such queries do not substitute for each other. You cannot usually
replace reading a record with inserting one.

Also remember that any program can run infinitely fast and with zero
storage if it doesn't have to produce the correct result.

Gordon L. Burditt
Apr 13 '06 #3
Gordon Burditt wrote:
Also remember that any program can run infinitely fast and with zero
storage if it doesn't have to produce the correct result.


Heh! Someone on comp.graphics once asked for a command to give the
absolute best compression for images. I suggested "rm". >:-)

Regards,
Bill K.
Apr 13 '06 #4
Thanks for the answers. I must say though that I don't have line of
sight. The path is blocked by several buildings and trees. I guess this
makes it much harder?

regards
Stijn

Apr 14 '06 #5

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

Similar topics

7
by: Randell D. | last post by:
Folks, I have a Javascript performance question that I might have problems explaining... In PHP, better performance can be obtained dealing directly with a variable, as opposed to an element...
115
by: Mark Shelor | last post by:
I've encountered a troublesome inconsistency in the C-language Perl extension I've written for CPAN (Digest::SHA). The problem involves the use of a static array within a performance-critical...
4
by: Martin | last post by:
I am using graphics as backgrounds for forms,buttons,labels etc. The question is: is it faster to load all graphics from files on app start or to use it embeded (places in editor during design)....
13
by: bjarne | last post by:
Willy Denoyette wrote; > ... it > was not the intention of StrousTrup to the achieve the level of efficiency > of C when he invented C++, ... Ahmmm. It was my aim to match the performance...
6
by: Mike | last post by:
Lets just say my app is done HOO HOO. Now, I'm accessing the database via a web service and one thing i noticed that my app is running real slow. When I first started working on the app is ran...
18
by: Rune B | last post by:
Hi Group I was considering using a Generic Dictionary<> as a value container inside my business objects, for the reason of keeping track of fields changed or added and so on. - But how...
5
by: Varangian | last post by:
Hi, I have a performance issue question? which is best (in terms of efficiency and performance, I don't care neatness in code)... building an ArrayList of Object Instances using SqlDataReader...
5
by: Markus Ernst | last post by:
Hello A class that composes the output of shop-related data gets some info from the main shop class. Now I wonder whether it is faster to store the info in the output class or get it from the...
5
by: toton | last post by:
Hi, I want a few of my class to overload from a base class, where the base class contains common functionality. This is to avoid repetition of code, and may be reducing amount of code in binary,...
30
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...

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.