asked on
ALTER TABLE z_vmailinglistreport ADD COMPUTED_comp_type AS COALESCE(comp_type, '');
-- And then create an index on the computed column:
CREATE INDEX ix_z_vmailinglistreport_COMPUTED_comp_type ON [z_vmailinglistreport](COMPUTED_comp_type);
BTW, tell the software vendors to stop using non-sargable queries and stop blaming you
ASKER
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY
ASKER
Any idea why the query runs almost instantly when I take the select statement from the underlying view and add the where clause to it (with the COALESCE) ?
Or if I add the where clause to the view it runs instantly as well.
Thanks, Kevin.