I have the following table
EVENT_LOG
:
EVENT_ID
: pk, int, not null- TYPEID: fk, int, not null
- CATEGORYID: fk, int, null
- SOURCE: varchar(255), null
- DESCRIPTION: varchar(4000), null
- CREATED: datetime, null
We've been creating a report, and found that performance sucks. There aren't any indexes aside from the clustered one. We could create them, but because this table is written to more than it is read from - there's a counter weighing performance concern. For the reporting, I'm inclined to put indexes on every column because the source & description columns need to be searched for substrings.
We wondered if an indexed view (AKA materialized view) would be an option, where the indexed view would contain all the columns from the EVENT_LOG
table but have the appropriate indexes created on the view. Would this get us the performance for reporting, while not impacting writes to the EVENT_LOG table?