{"html_url": "https://github.com/simonw/datasette/issues/255#issuecomment-388645828", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/255", "id": 388645828, "node_id": "MDEyOklzc3VlQ29tbWVudDM4ODY0NTgyOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-05-13T18:18:56Z", "updated_at": "2018-05-13T18:20:02Z", "author_association": "OWNER", "body": "I may be able to run the SQL for all of the facet counts in one go using a WITH CTE query - will have to microbenchmark this to make sure it is worthwhile: https://datasette-facets-demo.now.sh/fivethirtyeight-2628db9?sql=with+blah+as+%28select+*+from+%5Bcollege-majors%2Fall-ages%5D%29%0D%0Aselect+*+from+%28select+%22Major_category%22%2C+Major_category%2C+count%28*%29+as+n+from%0D%0Ablah+group+by+Major_category+order+by+n+desc+limit+10%29%0D%0Aunion+all%0D%0Aselect+*+from+%28select+%22Major_category2%22%2C+Major_category%2C+count%28*%29+as+n+from%0D%0Ablah+group+by+Major_category+order+by+n+desc+limit+10%29", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 322477187, "label": "Facets"}, "performed_via_github_app": null}