home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 968361285

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/335#issuecomment-968361285 https://api.github.com/repos/simonw/sqlite-utils/issues/335 968361285 IC_kwDOCGYnMM45uAVF 9599 2021-11-14T20:51:57Z 2021-11-14T20:51:57Z OWNER

SQLite will happily create multiple identical indexes on a table, using more disk space each time: ```pycon

import sqlite_utils db = sqlite_utils.Database("dupes.db") db["t"].insert_all({"id": i} for i in range(10000))

<Table t (id)> # dupes.db is 98304 bytes >>> db["t"].create_index(["id"]) <Table t (id)> # dupes.db is 204800 bytes >>> db["t"].indexes [Index(seq=0, name='idx_t_id', unique=0, origin='c', partial=0, columns=['id'])] >>> db["t"].create_index(["id"], index_name="t_idx_t_id_2") <Table t (id)> # 311296 bytes >>> db["t"].create_index(["id"], index_name="t_idx_t_id_3") <Table t (id)> # 417792 bytes >>> db.vacuum() # Still 417792 bytes ```
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
1042569687  
Powered by Datasette · Queries took 0.787ms · About: github-to-sqlite