Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8624007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:25:10+00:00 2026-06-12T07:25:10+00:00

I am new to SQL, please advise. I wish to logging incoming data from

  • 0

I am new to SQL, please advise.

I wish to logging incoming data from sensor every 5 seconds for future graph plotting
What is the best way to design database in MySQL?

  • Could i log with timestamp and use AVG functions when i like to display graph by hour, day, week, month ?

Or Could I log and make average every minute, hour, day to reduce database size

Is it possible to use trigger function to make average when collect data over 1 minute ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:25:11+00:00Added an answer on June 12, 2026 at 7:25 am

    The answer is that it depends on how much data you are actually going to be logging, how often you are going to be querying it, and how fast your response time needs to be. If it’s just one sensor, every 5 seconds, you could probably go on for eternity without running into too many problems with regular sql queries to pull out averages, sums, etc. in a reasonable period of time.

    I will say that from experience, you can do a lot with SQL and time series data, but you have to be very careful how you design your queries. I’ve worked with time series tables with billions of rows and tens of thousands of individual sensors among those rows; it’s possible to achieve very fast execution over that many time series rows, but you might spend a week trying to fine-tune the database. It’s definitely a trade-off between flexibility and speed.

    Again, for your purposes, it probably is not going to make very much difference if you are just talking about one sensor; just write a regular SQL query. However, if you anticipate adding several hundred more sensors or increasing the sample rate, you may want to consider doing periodic “rollup” functions as you suggest. And in that case, I would be more inclined to write a custom solution using a NoSQL database (e.g. Cassandra, Couchbase, etc.) and using a program that runs periodically to do the rollup. If you are interested, I can provide details, but I really don’t think you will need to go that far.

    This post has a pretty good discussion on storing time series data in SQL vs NOSQL: https://dba.stackexchange.com/questions/7634/timeseries-sql-or-nosql

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please explain the SQL query given below. I m new with SQL and struggling
I'm new to SQL. I have a simple problem with getting the results from
I am using following code to detach my DB from SQL Server express. Please
I am new to sql and programming so please bear with me. Is there
getting two arrays from controller and code is -- Sql db = new Sql(dataSource_wldb1)
I'm new to MyBatis and my project requires me to read the data from
I have a require ment to read data from a table(SQL 2005) and send
hi guys i am really new to sql so please be gentle with me
I am new to sql so please bear with me here. I have two
Possible Duplicate: XKCD SQL injection — please explain I'm very new in C# and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.