issue_comments: 779416619

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/sqlite-utils/issues/147#issuecomment-779416619 https://api.github.com/repos/simonw/sqlite-utils/issues/147 779416619 MDEyOklzc3VlQ29tbWVudDc3OTQxNjYxOQ== 9599 2021-02-15T19:40:57Z 2021-02-15T21:27:55Z OWNER

Tried this experiment (not proper binary search, it only searches downwards):

import sqlite3

db = sqlite3.connect(":memory:")

def tryit(n):
    sql = "select 1 where 1 in ({})".format(", ".join("?" for i in range(n)))
    db.execute(sql, [0 for i in range(n)])


def find_limit(min=0, max=5_000_000):
    value = max
    while True:
        print('Trying', value)
        try:
            tryit(value)
            return value
        except:
            value = value // 2

Running find_limit() with those default parameters takes about 1.47s on my laptop:

In [9]: %timeit find_limit()
Trying 5000000
Trying 2500000...
1.47 s ± 28 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

Interestingly the value it suggested was 156250 - suggesting that the macOS sqlite3 binary with a 500,000 limit isn't the same as whatever my Python is using here.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
688670158