{"html_url": "https://github.com/simonw/datasette/pull/2008#issuecomment-1407733793", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2008", "id": 1407733793, "node_id": "IC_kwDOBm6k_c5T6FAh", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-01-29T18:17:40Z", "updated_at": "2023-01-29T18:17:40Z", "author_association": "OWNER", "body": "> We don't have any performance tests yet - would be a useful thing to add, I've not built anything like that before (at least not in CI, I've always done as-hoc performance testing using something like Locust) so I don't have a great feel for how it could work.\r\n\r\nHad an interesting conversation about this just now: https://fedi.simonwillison.net/@simon/109773800944614366\r\n\r\nThere's a risk that different runs will return different results due to the shared resource nature of GitHub Actions runners, but a good fix for that is to run comparative tests where you run the benchmark against e.g. both `main` and the incoming PR branch and report back on any differences.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1560982210, "label": "array facet: don't materialize unnecessary columns"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2008#issuecomment-1407568923", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2008", "id": 1407568923, "node_id": "IC_kwDOBm6k_c5T5cwb", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-01-29T05:47:36Z", "updated_at": "2023-01-29T05:47:36Z", "author_association": "OWNER", "body": "> I don't know how/if you do automated tests for performance, so I haven't changed any of the tests.\r\n\r\nWe don't have any performance tests yet - would be a useful thing to add, I've not built anything like that before (at least not in CI, I've always done as-hoc performance testing using something like Locust) so I don't have a great feel for how it could work.\r\n\r\nI see not having to change the tests at all for this change as a really positive sign. If you find any behaviour differences between this and the previous that's a sign we should add a mother test or two specifying the behaviour we want.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1560982210, "label": "array facet: don't materialize unnecessary columns"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2008#issuecomment-1407567753", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2008", "id": 1407567753, "node_id": "IC_kwDOBm6k_c5T5ceJ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-01-29T05:39:54Z", "updated_at": "2023-01-29T05:40:34Z", "author_association": "OWNER", "body": "I absolutely _love_ this performance boost - really nice find.\r\n\r\nOne concern: this will be the first time Datasette ships a core feature that uses window functions.\r\n\r\nWindow functions were added to SQLite in [version 3.25.0](https://www.sqlite.org/releaselog/3_25_0.html) on 2018-09-15 - which means it's still very common for Datasette to run on versions that don't yet support them.\r\n\r\nSo I see two options:\r\n- Detect window function support and switch between the old implementation and this better, new one\r\n- Detect window functions and disable the facet-by-JSON feature entirely if they are missing\r\n\r\nI like the first option a bit better.\r\n\r\nThis also leads to a tricky CI challenge: Datasette needs to be able to run its test suite against more than one SQLite version to confidently test this feature going forward.\r\n\r\nI don't yet have a good GitHub Actions recipe for this, but I _really_ need one - for `sqlite-utils` too.\r\n\r\nMight be able to use this trick for that: https://til.simonwillison.net/sqlite/ld-preload", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1560982210, "label": "array facet: don't materialize unnecessary columns"}, "performed_via_github_app": null}