|
31 | 31 | ;; (Mailman/DMARC munging style). All downstream code (participants, |
32 | 32 | ;; commands, roles, reports, exports) reads author-address. |
33 | 33 | :email/author-name {:db/valueType :db.type/string} |
| 34 | + ;; Not indexed: stored verbatim, so value lookups must be |
| 35 | + ;; case-insensitive (bone.digest/open-patch-eids-by-sender compares |
| 36 | + ;; lowercased in a predicate, anchored on the :report/type index). |
34 | 37 | :email/author-address {:db/valueType :db.type/string} |
35 | 38 | :email/to {:db/valueType :db.type/string |
36 | 39 | :db/cardinality :db.cardinality/many} |
|
86 | 89 | ;; to :email/author-address) or, for proxy-capable state attrs, via |
87 | 90 | ;; the cached `-address` attr below -- which may diverge from the |
88 | 91 | ;; email's author-address when a maintainer uses the `-by` form. |
89 | | - :report/type {:db/valueType :db.type/keyword} |
| 92 | + ;; Indexed: every "open reports of type X" query (auto-supersede, |
| 93 | + ;; series, release :change closing, ...) filters by exact value. |
| 94 | + :report/type {:db/valueType :db.type/keyword |
| 95 | + :db/index true} |
90 | 96 | :report/email {:db/valueType :db.type/ref} |
91 | 97 | ;; Raw root Message-Id, kept verbatim for display/export; identity |
92 | 98 | ;; and lookups go through the hash (as for :email/message-id). |
|
184 | 190 | :db/unique :db.unique/identity} |
185 | 191 | :rel/from {:db/valueType :db.type/ref} |
186 | 192 | :rel/to {:db/valueType :db.type/ref} |
187 | | - :rel/kind {:db/valueType :db.type/keyword} |
| 193 | + ;; Indexed: :rel is the highest-cardinality entity, and nearly every |
| 194 | + ;; bone.relations query filters by a bound :rel/kind. (Not :rel/active?: |
| 195 | + ;; a boolean is barely more selective than a scan -- :rel/kind carries |
| 196 | + ;; the selectivity, :rel/active? is a cheap post-filter.) |
| 197 | + :rel/kind {:db/valueType :db.type/keyword |
| 198 | + :db/index true} |
188 | 199 | :rel/setter {:db/valueType :db.type/string} |
189 | 200 | :rel/email {:db/valueType :db.type/ref} |
190 | 201 | :rel/posed-at {:db/valueType :db.type/instant} |
|
203 | 214 | ;; --- Patch series --- |
204 | 215 | :series/id {:db/valueType :db.type/string |
205 | 216 | :db/unique :db.unique/identity} |
206 | | - :series/topic {:db/valueType :db.type/string} |
207 | | - :series/sender {:db/valueType :db.type/string} |
| 217 | + ;; Two independent AVET indexes (not a composite): every series |
| 218 | + ;; lookup binds both values, either index narrows the scan. |
| 219 | + :series/topic {:db/valueType :db.type/string |
| 220 | + :db/index true} |
| 221 | + :series/sender {:db/valueType :db.type/string |
| 222 | + :db/index true} |
208 | 223 | :series/expected {:db/valueType :db.type/long} |
209 | 224 | :series/cover-letter {:db/valueType :db.type/ref} |
210 | 225 | :series/patches {:db/valueType :db.type/ref |
|
0 commit comments