Groups | Search | Server Info | Login | Register


Groups > comp.lang.tcl > #55679

Re: Optimal used of sqlite

From meshparts <alexandru.dadalau@meshparts.de>
Newsgroups comp.lang.tcl
Subject Re: Optimal used of sqlite
Date 2026-04-29 23:50 +0200
Message-ID <10stufp$14srb$1@tota-refugium.de> (permalink)
References <10st8ah$14ekd$1@tota-refugium.de> <10st9d0$156i$1@dont-email.me> <10ste7r$15qud$1@tota-refugium.de> <10stg30$15s8e$1@tota-refugium.de> <10stt8j$14s5d$1@tota-refugium.de>

Show all headers | View raw


Am 29.04.2026 um 23:29 schrieb meshparts:
> Am 29.04.2026 um 19:44 schrieb meshparts:
>> Am 29.04.2026 um 19:13 schrieb meshparts:
>>> Am 29.04.2026 um 17:50 schrieb Rich:
>>>> Use sqlite's ability to directly address Tcl variables instead:
>>> Thanks Rich! I wasn't aware, that this trick also works for sqlight 
>>> (I know it from Tcl itself when using "expr".
>>>
>>> This indeed cut the time by 50%.
>>>
>>> I had to put the single quotes back though:
>>>
>>> db eval {INSERT INTO results VALUES('$step-global','$Im')}
>>>
>>> Without the quotes, I got some weird errors.
>>
>> I hat to roll back, since the new solution write empty string to the DB.
>>
>> At least my old command to retrieve the data does returns an empty 
>> string:
>>
>> db eval "SELECT data FROM results WHERE key='$setnum-global'"
>>
>> I don't understand why...
> 
> Got it: I'm using a variable in the first argument of VALUES, which is 
> not supported, when using curly braces.

So now I'm doing:

db eval "INSERT INTO results VALUES('$step-global',\$Im)"

Turns out this method is not faster than the original one.
The stated 50% cut in time was due to the previously wrong usage.
So back to the drawing board, still in need of a way to make INSERT of 
large lists faster.

Back to comp.lang.tcl | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 17:32 +0200
  Re: Optimal used of sqlite Rich <rich@example.invalid> - 2026-04-29 15:50 +0000
    Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 19:13 +0200
      Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 19:44 +0200
        Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 19:58 +0200
          Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 20:06 +0200
        Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 23:29 +0200
          Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 23:50 +0200
            Re: Optimal used of sqlite rene <user4652@newsgrouper.org.invalid> - 2026-04-30 09:22 +0000
              Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-30 11:43 +0200
                Re: Optimal used of sqlite rene <user4652@newsgrouper.org.invalid> - 2026-04-30 13:09 +0000
                Re: Optimal used of sqlite Ralf Fassel <ralfixx@gmx.de> - 2026-04-30 15:35 +0200
                Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-30 15:49 +0200
          Re: Optimal used of sqlite Rich <rich@example.invalid> - 2026-04-29 21:56 +0000
            Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-30 00:12 +0200
              Re: Optimal used of sqlite Rich <rich@example.invalid> - 2026-04-29 22:22 +0000
                Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-30 08:00 +0200
                Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-30 08:34 +0200
                Re: Optimal used of sqlite Ralf Fassel <ralfixx@gmx.de> - 2026-04-30 14:38 +0200
    Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 19:15 +0200
      Re: Optimal used of sqlite Rich <rich@example.invalid> - 2026-04-29 21:54 +0000
        Re: Optimal used of sqlite meshparts <alexandru.dadalau@meshparts.de> - 2026-04-30 00:08 +0200
        Re: Optimal used of sqlite Julian Bradfield <jcb@inf.ed.ac.uk> - 2026-04-30 10:25 +0000

csiph-web