August 15, 2008 at 6:48 am
I have a view that is based off a few tables and it keeps breaking every once in a while and we have to DROP/CREATE or ALTER it again to get it working again.
The tables behind the View.....
1. Agency table
2. Agency-to-lobs relational table
3. Allowable-lobs table
4. Lobs table
The Agency table is your standard "primary table behind a database app." So it gets touched a lot. The Agency-to-lobs table just keeps track of which Lines of Business are set up for that Agency. It also gets updated via the application. The Allowable-Lobs table stores which LOBs are available for each state. That table gets wiped clean every night and re-inserted. The LOBs table is very static and just stores which Lines of Business we have.
Every so often, a certain agency will start causing timeouts in the application. The line it's timing out on is a SP that uses the fore-mentioned View to verify that the agency has all the LOBs for that agency properly identified. No other agency will cause this timeout.....even agencies that would share state or LOBs with that agency. As soon as the view is re-Created, everything is just fine.
Why would this be happening? No structure changes are happening that should cause that View to break that I can think of so it's really become quite a dead-end at the moment.
Thanks in advance for any help.
August 15, 2008 at 6:52 am
For us to be better able to help you, you'll need to give us some DDL, some sample data and the like. Otherwise we'd just be taking wild stabs in the dark. Also, it would be good to include how your PK and FK relations are set up.
Thanks
-Luke.
August 15, 2008 at 7:05 am
here's my stab in the dark:
the agency in question probably has more data or more changes than the other agencies.
since the execution plan of a view is compiled, I'd guess that the statistics are growing out of date over time to gather the relevant data, and the execution plan for the view takes longer and longer.
can you tell us if statisics are set to automatic, or if you'vce got a manual plan to create/update statistics? maybe it's not updated often enough?
Lowell
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply