{"html_url": "https://github.com/simonw/datasette/issues/292#issuecomment-392343839", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/292", "id": 392343839, "node_id": "MDEyOklzc3VlQ29tbWVudDM5MjM0MzgzOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-05-27T16:10:09Z", "updated_at": "2018-06-04T17:38:04Z", "author_association": "OWNER", "body": "The more efficient way of doing this kind of count would be to provide a mechanism which can also add extra fragments to a `GROUP BY` clause used for the `SELECT`.\r\n\r\nOr... how about a mechanism similar to Django's `prefetch_related` which lets you define extra queries that will be called with a list of primary keys (or values from other columns) and used to populate a new column? A little unconventional but could be extremely useful and efficient.\r\n\r\nRelated to that: since the per-query overhead in SQLite is tiny, could even define an extra query to be run once-per-row before returning results.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 326800219, "label": "Mechanism for customizing the SQL used to select specific columns in the table view"}, "performed_via_github_app": null}