{"action":"created","issue":{"url":"https://api.github.com/repos/jotegui/large-dataset-uploader/issues/1","labels_url":"https://api.github.com/repos/jotegui/large-dataset-uploader/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/jotegui/large-dataset-uploader/issues/1/comments","events_url":"https://api.github.com/repos/jotegui/large-dataset-uploader/issues/1/events","html_url":"https://github.com/jotegui/large-dataset-uploader/issues/1","id":68382264,"number":1,"title":"Partition constraints can't use regular expressions","user":{"login":"jotegui","id":642210,"avatar_url":"https://avatars.githubusercontent.com/u/642210?v=3","gravatar_id":"","url":"https://api.github.com/users/jotegui","html_url":"https://github.com/jotegui","followers_url":"https://api.github.com/users/jotegui/followers","following_url":"https://api.github.com/users/jotegui/following{/other_user}","gists_url":"https://api.github.com/users/jotegui/gists{/gist_id}","starred_url":"https://api.github.com/users/jotegui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jotegui/subscriptions","organizations_url":"https://api.github.com/users/jotegui/orgs","repos_url":"https://api.github.com/users/jotegui/repos","events_url":"https://api.github.com/users/jotegui/events{/privacy}","received_events_url":"https://api.github.com/users/jotegui/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-14T13:48:39Z","updated_at":"2015-04-14T13:49:36Z","closed_at":null,"body":"via @jmalczyk:\r\nOur partitioned points table's aren't performing as fast as they could be because the check constraints are not being honored by the query planner. Currently we have constraints like:\r\n\r\n```sql\r\n    \"gbif_sep2014_7_species_check\" CHECK (species::text ~~ 'Ae%'::text OR species::text ~~ 'Te%'::text OR species::text ~~ 'Py%'::text OR species::text ~~ 'Ho%'::text OR species::text ~~ 'El%'::text OR species::text ~~ 'Lu%'::text OR species::text ~~ 'Re%'::text)\r\n```\r\n\r\nThese need to look more like this to actually work as intended.\r\n\r\n```sql\r\n    \"gbif_sep2014_7_species_check\" CHECK left(lower(species),2) IN ('ae', 'te', 'py', 'ho', 'el', 'lu','re')\r\n```"},"comment":{"url":"https://api.github.com/repos/jotegui/large-dataset-uploader/issues/comments/92855507","html_url":"https://github.com/jotegui/large-dataset-uploader/issues/1#issuecomment-92855507","issue_url":"https://api.github.com/repos/jotegui/large-dataset-uploader/issues/1","id":92855507,"user":{"login":"jotegui","id":642210,"avatar_url":"https://avatars.githubusercontent.com/u/642210?v=3","gravatar_id":"","url":"https://api.github.com/users/jotegui","html_url":"https://github.com/jotegui","followers_url":"https://api.github.com/users/jotegui/followers","following_url":"https://api.github.com/users/jotegui/following{/other_user}","gists_url":"https://api.github.com/users/jotegui/gists{/gist_id}","starred_url":"https://api.github.com/users/jotegui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jotegui/subscriptions","organizations_url":"https://api.github.com/users/jotegui/orgs","repos_url":"https://api.github.com/users/jotegui/repos","events_url":"https://api.github.com/users/jotegui/events{/privacy}","received_events_url":"https://api.github.com/users/jotegui/received_events","type":"User","site_admin":false},"created_at":"2015-04-14T13:49:36Z","updated_at":"2015-04-14T13:49:36Z","body":"via @jmalczyk\r\n@ljvillanueva, can you chime in here with what you found on this? If these constraints are not being used, we are hitting a lot of indexes that we don't need to be hitting right now."}}