github
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/359#issuecomment-412356537 | https://api.github.com/repos/simonw/datasette/issues/359 | 412356537 | MDEyOklzc3VlQ29tbWVudDQxMjM1NjUzNw== | 9599 | 2018-08-12T17:01:21Z | 2018-08-12T17:01:39Z | OWNER | Example table: https://latest-code.datasette.io/code/definitions Here's a query that does facet counting against that column: https://latest-code.datasette.io/code-a26fa3c?sql=select+count%28*%29+as+n%2C+j.value+from+definitions+join+json_each%28params%29+j+group+by+j.value+order+by+n+desc%3B ``` select count(*) as n, j.value from definitions join json_each(params) j group by j.value order by n desc; ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
349827640 | |
https://github.com/simonw/datasette/issues/359#issuecomment-412356746 | https://api.github.com/repos/simonw/datasette/issues/359 | 412356746 | MDEyOklzc3VlQ29tbWVudDQxMjM1Njc0Ng== | 9599 | 2018-08-12T17:05:00Z | 2018-08-12T17:05:00Z | OWNER | And here's the query for pulling back every record tagged with a specific tag: https://latest-code.datasette.io/code-a26fa3c?sql=select+*+from+definitions+where+rowid+in+%28%0D%0A++select+definitions.rowid%0D%0A++from+definitions+join+json_each%28params%29+j%0D%0A++where+j.value+%3D+%3Atag%0D%0A%29&tag=filename ``` select * from definitions where rowid in ( select definitions.rowid from definitions join json_each(params) j where j.value = :tag ) ``` | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
349827640 | |
https://github.com/simonw/datasette/issues/359#issuecomment-412357691 | https://api.github.com/repos/simonw/datasette/issues/359 | 412357691 | MDEyOklzc3VlQ29tbWVudDQxMjM1NzY5MQ== | 9599 | 2018-08-12T17:17:29Z | 2018-08-12T17:17:29Z | OWNER | Note that there doesn't seem to be a way to use indexes (even [indexes on expressions](https://www.sqlite.org/expridx.html)) to speed these up, so this will only ever be effective on smaller data sets, probably in the 10,000-100,000 range. Datasette is often used with smaller data sets so this is still worth pursuing. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
349827640 |