My application has a fixed set of SQL queries. These queries are run in polling mode, ever 10 seconds.
Because of the size of the database (> 100 GB), and the design (uber normalized), I am running into performance issues.
Is it possible to get incremental changes to a given query, whenever a CRUD event happens on the DB that changes the query's result? i.e. if I am querying all of the employees with last name FOO, then I want to be notified whenever a) a new employee joins with last name FOO b) an employee with last name FOO is fired etc etc.
I am running SQL Server 2005, btw.
Thanks!!
Edit: to clarify, the database size is 100GB. Queries are not stored procedures. Database is SQL Server 2005 (but could upgrade to 2008 if need be). Because the data is very normalized, I have JOINs of 9 or 10 tables in my queries. These queries are therefore quite slow. Even with indexing.
Currently, when the poll fires, I run my query on the entire database. Whether any records have changed or not. What I would like to do, ideally, would be to register my query with the server, and get a notification whenever there are any changes to the query result set. So, if a record gets added that matches my query, just notify me of this one change. I would think this would be better performance than re-running the entire query in a poll loop. This is what I mean by incremental. That way, I could just push the changes to my client, and get rid of the polling. Thanks again for all of the comments!