{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/datomish/issues/51","repository_url":"https://api.github.com/repos/mozilla/datomish","labels_url":"https://api.github.com/repos/mozilla/datomish/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/datomish/issues/51/comments","events_url":"https://api.github.com/repos/mozilla/datomish/issues/51/events","html_url":"https://github.com/mozilla/datomish/issues/51","id":175134859,"number":51,"title":"Include index flag(s) to enable non-standard index walks in queries","user":{"login":"ncalexan","id":1097182,"avatar_url":"https://avatars.githubusercontent.com/u/1097182?v=3","gravatar_id":"","url":"https://api.github.com/users/ncalexan","html_url":"https://github.com/ncalexan","followers_url":"https://api.github.com/users/ncalexan/followers","following_url":"https://api.github.com/users/ncalexan/following{/other_user}","gists_url":"https://api.github.com/users/ncalexan/gists{/gist_id}","starred_url":"https://api.github.com/users/ncalexan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncalexan/subscriptions","organizations_url":"https://api.github.com/users/ncalexan/orgs","repos_url":"https://api.github.com/users/ncalexan/repos","events_url":"https://api.github.com/users/ncalexan/events{/privacy}","received_events_url":"https://api.github.com/users/ncalexan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-05T23:00:37Z","updated_at":"2016-09-06T02:36:11Z","closed_at":null,"body":"We have a few non-standard (opt-in) indexes defined: AVET and VAET for looking up `:db/index true` and `:db.type/ref` attributes, respectively.  The indexes are defined with flags, like:\r\n```clojure\r\n;; Opt-in index: only if a has :db/index true.\r\n\"CREATE UNIQUE INDEX idx_datoms_avet ON datoms (a, value_type_tag, v, e)\r\n WHERE index_avet IS NOT 0\"\r\n```\r\nthat means we need to include `index_avet` in the query (in some way) to enable SQLite to walk that index.  Further, we may need to tweak the index definition, since SQLite more or less uses queries only if they \"directly match\" the query syntax: https://www.sqlite.org/partialindex.html."},"comment":{"url":"https://api.github.com/repos/mozilla/datomish/issues/comments/244836537","html_url":"https://github.com/mozilla/datomish/issues/51#issuecomment-244836537","issue_url":"https://api.github.com/repos/mozilla/datomish/issues/51","id":244836537,"user":{"login":"rnewman","id":91722,"avatar_url":"https://avatars.githubusercontent.com/u/91722?v=3","gravatar_id":"","url":"https://api.github.com/users/rnewman","html_url":"https://github.com/rnewman","followers_url":"https://api.github.com/users/rnewman/followers","following_url":"https://api.github.com/users/rnewman/following{/other_user}","gists_url":"https://api.github.com/users/rnewman/gists{/gist_id}","starred_url":"https://api.github.com/users/rnewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnewman/subscriptions","organizations_url":"https://api.github.com/users/rnewman/orgs","repos_url":"https://api.github.com/users/rnewman/repos","events_url":"https://api.github.com/users/rnewman/events{/privacy}","received_events_url":"https://api.github.com/users/rnewman/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T02:36:11Z","updated_at":"2016-09-06T02:36:11Z","body":"Heh, I was showerthinking about this today, along with generating LIMIT 1 subqueries for unique attributes. There's a lot we could do by simply printing a query, EXPLAINing it, timing it, and tweaking the SQL we generate.\r\n\r\nWe might also consider directly doing `CREATE INDEX … WHERE a = 123` as attribute definitions are transacted… it has its advantages and disadvantages. "}}
{"actor":{"display_login":"rnewman"}}