Skip to content

Commit 1aa89a2

Browse files
committed
docs(guides): audit database indexes guide
1 parent b423a0a commit 1aa89a2

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

docs/guides/database-indexes-guide.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,30 @@ options.Schema.For<ApplicationUser>()
105105
| `CreatedAt` | B-tree | Sorting users by registration date |
106106
| `CreatedAt` (partial, `EmailConfirmed = false`) | B-tree | Efficiently query unverified accounts for cleanup/alerting |
107107

108+
### Projections Without Explicit Indexes
109+
110+
The following projections are persisted but do not define explicit indexes in `ConfigureIndexes`. They are primarily accessed by document ID (primary key), so additional indexes are not currently required.
111+
112+
#### `UserProfile`
113+
- Access pattern: direct lookup by `userId`
114+
- Why no explicit index: shopping cart/favorites data is loaded by ID, not searched
115+
116+
#### `BookStatistics`
117+
- Access pattern: direct lookup by `bookId`
118+
- Why no explicit index: statistics are loaded per book detail view
119+
120+
#### `AuthorStatistics`
121+
- Access pattern: direct lookup by `authorId`
122+
- Why no explicit index: aggregate counters are loaded by ID only
123+
124+
#### `CategoryStatistics`
125+
- Access pattern: direct lookup by `categoryId`
126+
- Why no explicit index: aggregate counters are loaded by ID only
127+
128+
#### `PublisherStatistics`
129+
- Access pattern: direct lookup by `publisherId`
130+
- Why no explicit index: aggregate counters are loaded by ID only
131+
108132
## Index Types Used
109133

110134
| Type | Marten API | When to use |

0 commit comments

Comments
 (0)