{"action":"created","issue":{"url":"https://api.github.com/repos/simonw/datasette/issues/189","repository_url":"https://api.github.com/repos/simonw/datasette","labels_url":"https://api.github.com/repos/simonw/datasette/issues/189/labels{/name}","comments_url":"https://api.github.com/repos/simonw/datasette/issues/189/comments","events_url":"https://api.github.com/repos/simonw/datasette/issues/189/events","html_url":"https://github.com/simonw/datasette/issues/189","id":309471814,"number":189,"title":"Ability to sort (and paginate) by column","user":{"login":"simonw","id":9599,"avatar_url":"https://avatars0.githubusercontent.com/u/9599?v=4","gravatar_id":"","url":"https://api.github.com/users/simonw","html_url":"https://github.com/simonw","followers_url":"https://api.github.com/users/simonw/followers","following_url":"https://api.github.com/users/simonw/following{/other_user}","gists_url":"https://api.github.com/users/simonw/gists{/gist_id}","starred_url":"https://api.github.com/users/simonw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonw/subscriptions","organizations_url":"https://api.github.com/users/simonw/orgs","repos_url":"https://api.github.com/users/simonw/repos","events_url":"https://api.github.com/users/simonw/events{/privacy}","received_events_url":"https://api.github.com/users/simonw/received_events","type":"User","site_admin":false},"labels":[{"id":729586521,"url":"https://api.github.com/repos/simonw/datasette/labels/medium","name":"medium","color":"ca08d1","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-03-28T18:04:51Z","updated_at":"2018-03-30T07:06:21Z","closed_at":null,"author_association":"OWNER","body":"As requested in https://github.com/simonw/datasette/issues/185#issuecomment-376614973\r\n\r\nI've previously avoided this for performance reasons: sort-by-column on a column without an index is likely to perform badly for hundreds of thousands of rows.\r\n\r\nThat's not a good enough reason to avoid the feature entirely though. A few options:\r\n\r\n* Allow sort-by-column by default, give users the option to disable it for specific tables/columns\r\n* Disallow sort-by-column by default, give users option (probably in `metadata.json`) to enable it for specific tables/columns\r\n* Automatically detect if a column either has an index on it OR a table has less than X rows in it\r\n\r\nWe already have the mechanism in place to cut off SQL queries that take more than X seconds, so if someone DOES try to sort by a column that's too expensive it won't actually hurt anything - but it would be nice to not show people a \"sort\" option which is guaranteed to throw a timeout error.\r\n\r\nThe vast majority of datasette usage that I've seen so far is on smaller datasets where the performance penalties of sort-by-column are extremely unlikely to show up."},"comment":{"url":"https://api.github.com/repos/simonw/datasette/issues/comments/377462334","html_url":"https://github.com/simonw/datasette/issues/189#issuecomment-377462334","issue_url":"https://api.github.com/repos/simonw/datasette/issues/189","id":377462334,"user":{"login":"simonw","id":9599,"avatar_url":"https://avatars0.githubusercontent.com/u/9599?v=4","gravatar_id":"","url":"https://api.github.com/users/simonw","html_url":"https://github.com/simonw","followers_url":"https://api.github.com/users/simonw/followers","following_url":"https://api.github.com/users/simonw/following{/other_user}","gists_url":"https://api.github.com/users/simonw/gists{/gist_id}","starred_url":"https://api.github.com/users/simonw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonw/subscriptions","organizations_url":"https://api.github.com/users/simonw/orgs","repos_url":"https://api.github.com/users/simonw/repos","events_url":"https://api.github.com/users/simonw/events{/privacy}","received_events_url":"https://api.github.com/users/simonw/received_events","type":"User","site_admin":false},"created_at":"2018-03-30T07:06:21Z","updated_at":"2018-03-30T07:06:21Z","author_association":"OWNER","body":"Maybe the answer here is that anything that's encoded in the next token is treated as >= with the exception of columns known to be primary keys, which are treated as >"}}
{"actor":{"display_login":"simonw"}}