ghqwerty's Profile User Rating: -----

Reputation: 43 Craftsman
Contributor w/DIC++
Active Posts:
900 (0.41 per day)
08-August 08
Profile Views:
Last Active:
User is offline Jul 24 2014 05:17 AM

Previous Fields

OS Preference:
Favorite Browser:
Favorite Processor:
Favorite Gaming Platform:
Your Car:
Who Cares
Dream Kudos:

Latest Visitors

Icon   ghqwerty has not set their status

Posts I've Made

  1. In Topic: Is it quicker to read from a database or perform the calculations

    Posted 18 Jul 2014

    What do you mean, by the database? I wasn't aware they had such functionality?
  2. In Topic: Is it quicker to read from a database or perform the calculations

    Posted 18 Jul 2014

    Hi Jim, thanks for the response.


    If they involve the entire data set then it would probably be better to store the raw data.

    This is pretty much the confirmation I was looking for. I was primarily wondering if the performance benefit of only having to calculate the data once would outweigh the effort required to maintain the database as it evolved. I get that this problem relies a hell of a lot on the implementation and the decision would depend on the requirements of the program and so either solution could be the best one.

    However, on a more fundamental level, how efficient is reading and writing from a database compared to performing operations in code? surely there a lot of overheads involved in having to open the db, find the correct rows and then return them to my program (the sqllite library is 100k+ lines, so surely that means that theres a lot going on?)
    Furthermore, when reading and writing from a database how does the complexity vary as the number of columns increase? Would it be linear or less than?

    E.g. would 8 columns take twice as long to read/write as 4?


    No one here can possibly answer this question with the limited information you provided. This is a design decision that someone knowledgeable about the complete system should make. Perhaps you should discuss this matter with your superiors, colleagues, or the potential users of your system.

    This is why I put quotes around right. I now see this is more of a design decision than one based on the performance of the database. By the way, this is a personal project.


    What does the raw data look like, and what calculations are to be done on that data?

    This is an example of a line of raw data.
    52 2014-07-14 95.70 96.06 95.54 95.84 19579000.00

    calculations include moving averages, highest and lowest value over a time period, the change in values from one day to the next.
    Eventually I also want to be able to 'trend spot'
  3. In Topic: Is it quicker to read from a database or perform the calculations

    Posted 18 Jul 2014

    I don't fully understand your response sorry, what do you mean by rehydrate the object?
    I should make clear that the calculations are being made in my C++ program, not the DB.

    It's a SQL database. I'll try better to demonstrate my question

    Read from files
    Perform calculations (can be more complex than just averages and sums) in c++ program
    Store ALL data

    Then when I next want to look at the data
    Read from db - This will give me every value straight away, however, every time I want to add a new value to analyse I will need to add a new column in the database and retrospectively fill it with data for all currently stored entries

    Read from files
    store raw data

    Read from DB
    Perform calculations in program
  4. In Topic: Unexpected warning - unused parameter

    Posted 15 Jul 2014

    Wellll, this is embarrassing.

    Before I first looked at the warnings I must have done some work above the code because the line numbers were offset. The actual warnings were to the functions after each of the ones I mentioned and do indeed include unused parameters (from where I have commented out sections)

    Wow. Sorry about that.
  5. In Topic: Unexpected warning - unused parameter

    Posted 15 Jul 2014

    Jim, I have Vector and String included if they are what you mean?

    CT, Yep, still works the same.

    My only thought is that in the event that watchList is empty then would it be used? (wouldn't happen but not sure if the compiler can recognize that?)

My Information

Member Title:
if($spareTime > 0){ $this->writeCode(); }
Age Unknown
Birthday Unknown
study room
Years Programming:
Programming Languages:
php, css, html
learning - c#, javascript, jquery(javascript), ajax

Contact Information

Click here to e-mail me



ghqwerty has no profile comments yet. Why not say hello?