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 6811643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:21:09+00:00 2026-05-26T20:21:09+00:00

I am reading several files from linux /proc fs and I will have to

  • 0

I am reading several files from linux /proc fs and I will have to insert those values in a database. I should be as optimal as possible. So what is cheaper:

i) to cast then to int, while I stored then in memory, for later cast to string again while I build my INSERT statement

ii) or keep them as string, just sanitizing the values (removing ‘:’, spaces, etc…)

iii) What should I take in account to learn to make this decision?

I am already doing a split in the lines, because the order they came is not good enough for me.

Thanks,

Pedro

Edit – Clarification

Sorry guys, my scenario is the following: I am measuring cpu, memory, network, disk, etc… every 10 seconds. We are developing our database system, so I cannot count with anything more than just INSERT statements.

I got interested in this optimization because the frequency off parsing data. Its gonna be write once – there will be no updates over the data after it is written.

  • 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-05-26T20:21:09+00:00Added an answer on May 26, 2026 at 8:21 pm

    You seem to be performing some archiving activity [write-once, read-probably-atmost-once] (storing the DB for a later rare/non-frequent use), if not, you should put the optimization emphasize based on how the data will be read (not written).

    If this is the archiving case, maybe inseting BLOBs (binary large objects, [or similar concepts]) into the DB will be more efficient.

    Addition:
    Apparently it will depend on how you will read the data. Are you just listing the data for browse purpose later on, or there will be more complex fetching queries based on the benchmark values.
    For example if you are later performing something like: SELECT * from db.Log WHERE log.time > time1 and Max (Memory) < 5000 then it is best to keep each data in its original format (int in integer, string in String, etc) so that the main data processing is left to DB server.

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

Sidebar

Related Questions

I have several fairly large XML files that represent data exported from a system
I'm reading binary data (either by network stream or from files) that is predefined
I have several log files of events (one event per line). The logs can
Background: I have an application which plays video files from disc. When I play
I'm having several issues based around reading and writing an NSArray to and from
I have several large files that I'm processing and I'm using the backgroundWorker1.ReportProgress(percent) to
I have several (~2GB) raw 24bpp RGB files on HDD. Now I want to
After reading several questions regarding problems with compilation (particularly C++) and noticing that in
I've tried to do this several times with no luck. After reading this post
I have an application which reads in gridded coordinate data with values (i.e. lat,

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.