Any way to improve the performance of SQL query with optional parameters ?

This query returns correct data, just appears to be a bit slower than hoped (about 0.9s in testing on development box)
I will be calling it up to 150 times in succession from my app, using different DocId's
The idea is to determine docrevision with highest priority, including testing a requested docrevision to see what it's priority would be.

ProjectId is alway available. usually only one of DocId and DocNo will be supplied.
I need the RevStyles as a LIKE operation, but am looking at removing the option for LIKE testing of DocId

just realised i had too many tables in second query. Removing them makes a significant improvement by itself.

UNION
SELECT rtrim(@TestRev) as RevId, Proj_RevStyles.Priority as Priority
FROM dbo.Proj_Codes , dbo.Proj_RevStyles
WHERE Proj_Codes.ProjectNo = @ProjectId
AND Proj_Codes.RevisionStyle = Proj_Revstyles.Id
AND ((@TestRev IS NOT NULL) AND (@TestRev LIKE Proj_Revstyles.Tag))

Featured Post

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Introduction
SQL Server Integration Services can read XML files, that’s known by every BI developer. (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.)
But how far can you go? When does the XML Source component become …

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…