Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. If I need to update data into SQLight constantly , do I need to open new thread?
Forum Updated to NodeBB v4.3 + New Features

If I need to update data into SQLight constantly , do I need to open new thread?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    umen242
    wrote on last edited by
    #1

    Hi
    In my application I have input that im getting from web service , this input translated to 20 units/structures of data .
    The representation in the db is , that each unit will be raw in the db .
    Now im collecting the data in the memory and I like to insert this data in db .
    What strategy will be the best?
    To open thread in the background that will handle the inserts ,
    If yes , what she'll be the best and less cpu/memory hungry . insert raw by raw or to insert chancks of 20 raw in each insert ?
    I want this operation to be as much as silent and not noticeable by the user

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      It depends on how often that input will come in. If it's only sparse, you can do it in the GUI thread, I would say. Else, I would move it to a separate thread. In a thread it wouldn't make that much different if you insert one by one or in chunks.

      But there is no "best strategy", such things always depend on the actual use case.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved