Database abstraction, scope, multi-threading.

A few stack layers out is my loop requesting each record by rowid. And there's 
no predicting which thread will make the request. Likely, there will be 50 
threads making very similar requests at the same time.


If I could clone the statement, then I could make one that remains static. And 
each time I need it, I clone it, use it, and throw it away. I'm sure I would 
need some thread synchronization while performing the clone, but it would be a 
much briefer period than if I were trying to share a single statement with all 
threads.


If cloning isn't an option, I can create a statement pool; I would just prefer 
the simpler option.


Thanks
dw



  _____  

From: Igor Tandetnik [mailto:itandet...@mvps.org]
To: sqlite-users@sqlite.org
Sent: Tue, 19 Apr 2011 17:08:09 -0600
Subject: Re: [sqlite] Multiple Match statements per query

On 4/19/2011 6:57 PM, Dave White wrote:
  > So, if I could prepare the statement once, then clone it every time I
  > need to use it, I may see a 4 fold speed increase when calling this
  > operation frequently.
  
  Why can't you just reuse the same statement every time? Are you aware of 
  sqlite3_reset ?
  -- 
  Igor Tandetnik
  
  _______________________________________________
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
    
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to