VMware Horizon Community
MorDrakka
Contributor
Contributor

Cleaning the View Event Database

Hi all,

We have a large VDI environment where each View Broker set facilitates 2000 workstations. As such there is alot of data in our View Event database. There is no default cleaning mechanism in place. So I want to create a query which can clean this for me. This query using select instead of delete, when it is fully optimized I switch to delete.

I want to delete all events older then 180 days.

The View Event database has data in two tables, so I used a join. However this seems slow, since SQL joins the entire table before deletion.

select *

from dbo.vdievent

JOIN dbo.vdievent_data

ON dbo.vdievent.EventID = dbo.vdievent_data.EventID

where dbo.vdievent.Time < (getdate()-180)

I am looking for another method which searches the dbo.vdievent table for all events older then 180 days, then deletes these events from both tables(dbo.vdievent, dbo.vdievent_data). Is there a more efficient way to do this?

Thanks,

Ad van Bokhoven


Reply
0 Kudos
0 Replies