home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 474407617

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/datasette/issues/420#issuecomment-474407617 https://api.github.com/repos/simonw/datasette/issues/420 474407617 MDEyOklzc3VlQ29tbWVudDQ3NDQwNzYxNw== 9599 2019-03-19T14:55:51Z 2019-03-19T14:55:51Z OWNER

A microbenchmark against fivethirtyeight.db (415 tables):

In [1]: import sqlite3                                                                                              
In [2]: c = sqlite3.connect("fivethirtyeight.db")                                                                   
In [3]: %timeit c.execute("select name from sqlite_master where type = 'table'").fetchall()                         
283 µs ± 12.3 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
In [4]: tables = [r[0] for r in c.execute("select name from sqlite_master where type = 'table'").fetchall()]        
In [5]: len(tables)                                                                                                 
Out[5]: 415
In [6]: %timeit [c.execute("pragma foreign_keys([{}])".format(t)).fetchall() for t in tables]                       
1.81 ms ± 161 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)

So running pragma foreign_keys() against 415 tables only takes 1.81ms. This is going to be fine.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
421971339  
Powered by Datasette · Queries took 0.917ms · About: github-to-sqlite