>I edited this second script to use plain apsw.
>In the vi editor:
>%s/db.execute/db.cursor().execute/
>%s/executescript/execute/
>%s/db.commit()/db.cursor().execute("COMMIT")/
>/Method 9
>.,$d
>
>(the carray tests are left out)
>My test output for 1000 keys is:
>$ python3 keith2b.py 1000
>Creating
>
> Op 17 sep. 2019, om 04:26 heeft Keith Medcalf het
> volgende geschreven:
>
>
> On Monday, 16 September, 2019 14:22, E.Pasma wrote:
>
>> Stop stop stop
>
> You are right. What a difference a spelling error makes ... No wonder it
> took so long as it was doing table scans -- and the opt
On Fri, Sep 13, 2019 at 6:38 PM Jens Alfke wrote:
> (b) Execute "SELECT key, … FROM table WHERE key IN (…)", including all of
> the key strings.
>
> If I do (b), SQLite has less setup work to do, and it could potentially
> optimize the b-tree lookup. On the downside, I have to prepare a statement
> On Sep 13, 2019, at 1:30 PM, Keith Medcalf wrote:
>
> The only thing that is clear is that where the overhead of executing each
> select is significant it is clearly better to execute fewer of them.
Thanks for the research, Keith!
In my case the per-query overhead is lower since I'm using
SQLite mailing list
> Subject: Re: [sqlite] Fastest way to SELECT on a set of keys?
>
>
> That depends greatly on the overhead you have for executing each
> select statement. So I wrote a little test that uses my
> customized apsw library from Python 3. It also works using the
ed(rowset))):
pass
print(elapsed(st, time.time()))
--
The fact that there's a Highway to Hell but only a Stairway to Heaven says a
lot about anticipated traffic volume.
>-Original Message-
>From: sqlite-users On
>Behalf Of Jens Alfke
>Sent: Friday, 13 September, 2019 1
SELECT on a set of keys? On 13 Sep 2019, at 5:38pm, Jens Alfke
wrote:> Does anyone have intuition or actual knowledge
about which approach is better? Or know of a 3rd better approach?My guess is
(b), but it will depend on your particular setup. Depends on cache size,
storage speed, whether your
On 9/13/19, Jens Alfke wrote:
> If I have a set of primary keys (let's say a few hundred) and need to fetch
> data from the table rows with those keys, what's the fastest way to do so?
> The options seem to be:
>
> (a) Execute "SELECT … FROM table WHERE key=?", once for each key.
> (b) Execute "SE
Jens Alfke, on Friday, September 13, 2019 12:38 PM, wrote...
> (a) Execute "SELECT … FROM table WHERE key=?", once for each key.
> (b) Execute "SELECT key, … FROM table WHERE key IN (…)", including all of the
> key strings.
I have found that the ... IN ... has provided a much faster result than
On 13 Sep 2019, at 5:38pm, Jens Alfke wrote:
> Does anyone have intuition or actual knowledge about which approach is
> better? Or know of a 3rd better approach?
My guess is (b), but it will depend on your particular setup. Depends on cache
size, storage speed, whether your OS is real or virt
If I have a set of primary keys (let's say a few hundred) and need to fetch
data from the table rows with those keys, what's the fastest way to do so? The
options seem to be:
(a) Execute "SELECT … FROM table WHERE key=?", once for each key.
(b) Execute "SELECT key, … FROM table WHERE key IN (…)"
11 matches
Mail list logo