2 thoughts on “The SQL Server Performance Tasting Menu: Trivial Plans

  1. It’s interesting that for a “SELECT COUNT(*) FROM table” query, SQL Server will use a TRIVIAL optimization level, even though it still has to make a decision. It has to decide which of the indexes on the table to scan – either the clustered index or one of many possible nonclustered indexes.

    1. Sure, but as far as costing decisions go, you’re still maintaining the same plan shape, so it’s more a matter of picking the “smallest” index to read from. I’d consider that a trivial decision compared to other stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *