sub,
My system is pretty slow to load the TV Guide after it's started up. With almost 1000 cable channels and 14 days of EPG data, there are over 142,000 rows in the gbpvr database's PROGRAMME table. On my system it takes about 6-8 minutes for the EPG data to fully load.
Now it just so happens that my cable system's HD channels are all in the 900-999 channel range and being spoiled to HD, more often than not when I'm starting up pvrx2 on my system - either PC or PCH - I'm then waiting almost that full 6-8 minutes for the guide to load so I can watch an HD channel. Frustrating, especially because the PCH's other features have me getting in and out of gbpvr more often now.
So tonight while poking around in the gbpvr database I noticed an opportunity to improve this. Figuring that the long load time was due to gbpvr needing to look up program information one channel at a time in start_time order, I added an index on PROGRAMME's channel_oid and start_time fields to see if it would help. The performance improvement was dramatic. The entire EPG data loads now in approximately 10 seconds!
The new index added approximate 6 meg to my 50 meg database and I'm sure it will slow down the EPG load some, but it seems well worth it.
Here's the index statement I used:
create index programme_epg on PROGRAMME (channel_oid, start_time)
For anyone else who might be interested in trying this, but doesn't now how:
[/INDENT][/INDENT]
Tim
P.S. I created a unique index originally, but a couple people since have found the combo of channel_oid and start_time aren't unique in their database, so I removed the unique keyword from the instructions above. The index is just as effective without the condition.
My system is pretty slow to load the TV Guide after it's started up. With almost 1000 cable channels and 14 days of EPG data, there are over 142,000 rows in the gbpvr database's PROGRAMME table. On my system it takes about 6-8 minutes for the EPG data to fully load.
Now it just so happens that my cable system's HD channels are all in the 900-999 channel range and being spoiled to HD, more often than not when I'm starting up pvrx2 on my system - either PC or PCH - I'm then waiting almost that full 6-8 minutes for the guide to load so I can watch an HD channel. Frustrating, especially because the PCH's other features have me getting in and out of gbpvr more often now.
So tonight while poking around in the gbpvr database I noticed an opportunity to improve this. Figuring that the long load time was due to gbpvr needing to look up program information one channel at a time in start_time order, I added an index on PROGRAMME's channel_oid and start_time fields to see if it would help. The performance improvement was dramatic. The entire EPG data loads now in approximately 10 seconds!
The new index added approximate 6 meg to my 50 meg database and I'm sure it will slow down the EPG load some, but it seems well worth it.
Here's the index statement I used:
create index programme_epg on PROGRAMME (channel_oid, start_time)
For anyone else who might be interested in trying this, but doesn't now how:
- Let's assume sub doesn't point out a problem with doing this and I don't post back tomorrow explaining my overnight EPG load ran for 36 hours.
- There are a few free tools available for accessing SQLite databases. I downloaded the tool SQLite Database Browser.
- Shut down the recording service and exit gbpvr.
- The database is in the gbpvr install directory, called gbpvr.db3. Copy this file to a backup that you can restore in case you screw it up.
- Open the gbpvr.db3 database using the database browser.
- In the Execute SQL window, run the following command:
[/INDENT][/INDENT]
- Save your changes and exit the database.
- Restart the recording service and pvrx2. If all went well you should notice the EPG loads significantly faster now.
Tim
P.S. I created a unique index originally, but a couple people since have found the combo of channel_oid and start_time aren't unique in their database, so I removed the unique keyword from the instructions above. The index is just as effective without the condition.