Using SI in view with analitical function

Hi All,

I've got a problem with performance whilst reading from view. I need to present state of contracts on each day. To avoid storing same information in table for every day a created table A with intervals and then created view that joins it with another table B(table has one column with STATE_DATE) and produces state for each day with last EVENT.

Below is example(in real table A has more than 20 millions of records)