NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Legacy (v4.x and earlier) v
« Previous 1 … 186 187 188 189 190 … 433 Next »
Issuing VACUUM on npvr's database?

Issuing VACUUM on npvr's database?
Spark
Offline

Member

Posts: 106
Threads: 32
Joined: Jan 2009
#1
2015-04-28, 11:26 PM
I was just curious, have other people tried to vacuum their NPVR database npvr.db3?

The database was compacted using VACUUM statement.
Before compacting:
Page Count = 39045
Database Size = 39982080 bytes
After compacting:
Page Count = 532
Database Size = 544768 bytes

Nice cleanup. Smile
NYPlayer
Offline

Senior Member

Posts: 308
Threads: 22
Joined: Aug 2014
#2
2015-04-28, 11:37 PM
This is how I do it ... it checks to see if something is recording. If not shuts down service Vacuums and restarts service. It keeps checking every 5 minutes... once it is vacuumed it exits.


Code:
CD /d "%~dp0"
:loop
set chknpvr=1
"c:\Program Files (x86)\NPVR\NScriptHelper.exe" -isInUse | find "NOT RECORDING"
set chknpvr=%ERRORLEVEL%
if %chknpvr% EQU 0 net stop "NPVR Recording Service"
if %chknpvr% EQU 0 sqlite3.exe "C:\Users\Public\NPVR\npvr.db3" "VACUUM;"
if %chknpvr% EQU 0 net start "NPVR Recording Service"
if %chknpvr% NEQ 0 timeout 300
if %chknpvr% NEQ 0 goto loop
exit
NEXTPVR Server Acer AM3910-UR10P Intel Core i3-540 3.06GHz Desktop, Windows 8.1 Pro. 64bit, 2 HdHomerun units(OTA Tuners) , 1 HD Homerun Prime , for a total of 7 HD Tuners , LinkSYS 16 port Gigabyte Switch.
D-link 857 Router
Spark
Offline

Member

Posts: 106
Threads: 32
Joined: Jan 2009
#3
2015-04-28, 11:41 PM
NYPlayer Wrote:This is how I do it ... it checks to see if something is recording. If not shuts down service Vacuums and restarts service. It keeps checking every 5 minutes.


Code:
:loop
set chknpvr=1
"c:\Program Files (x86)\NPVR\NScriptHelper.exe" -isInUse | find "NOT RECORDING"
set chknpvr=%ERRORLEVEL%
if %chknpvr% EQU 0 net stop "NPVR Recording Service"
if %chknpvr% EQU 0 sqlite3.exe "C:\Users\Public\NPVR\npvr.db3" "VACUUM;"
if %chknpvr% EQU 0 net start "NPVR Recording Service"
if %chknpvr% NEQ 0 timeout 300
if %chknpvr% NEQ 0 goto loop
exit

Hey, that pretty slick... didn't think about adding it to a script to do it, nor did I know that there was a way to query npvr to see if it was doing anything or not.
Thanks!
Lao Pan
Offline

Posting Freak

UK (Mendip TX)
Posts: 1,301
Threads: 114
Joined: Oct 2008
#4
2015-04-29, 08:32 AM
Spark Wrote:I was just curious, have other people tried to vacuum their NPVR database npvr.db3?

- - -

Nice cleanup. Smile

I was under the impression that Nrecord did this - either on start or stop of the service (I can't remember which). Although if you never shut down the computer or restart the recording service, it wouldn't have a chance.

I used to vacuum the db back in GBPVR days.
It's not an overly complicated system - it's more - overly simple operatives  Huh
johnsonx42
Offline

Posting Freak

Posts: 7,298
Threads: 189
Joined: Sep 2008
#5
2015-04-29, 04:37 PM
I just tried it, no change in the npvr.db3 size, still 9.5MB.
server: NextPVR 5.0.7/Win10 2004/64-bit/AMD A6-7400k/hvr-2250 & hvr-1250/Winegard Flatwave antenna/Schedules Direct
main client: NextPVR 5.0.7 Desktop Client; LG 50UH5500 WebOS 3.0 TV
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,814
Threads: 769
Joined: Nov 2003
#6
2015-04-29, 05:29 PM
Lao Pan Wrote:I was under the impression that Nrecord did this - either on start or stop of the service (I can't remember which).
We used to do something like this when using an MS Access with GBPVR. Access database files would grow at a phenomenal and uncontrollable rate. I've never found the need to do this with a SQLite databases. These databases are pretty good at reclaiming and reusing any free space.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,814
Threads: 769
Joined: Nov 2003
#7
2015-04-29, 05:33 PM
Spark Wrote:I was just curious, have other people tried to vacuum their NPVR database npvr.db3?

The database was compacted using VACUUM statement.
Before compacting:
Page Count = 39045
Database Size = 39982080 bytes
After compacting:
Page Count = 532
Database Size = 544768 bytes

Nice cleanup. Smile
Honestly, I don't think those results are what you'd get in the real world. A lot of US users have nearly 500,000 listings, and will often have a database between 30-50MB, and that's what I'd consider normal. A database with 500,000 listings isn't going to shrink down to about 500,000 bytes. ie one byte per listing.

You'd possibly see results like this if you have a full listing database, then did an Empty EPG, then vacuumed it. As soon as you update the EPG, pulling in the listings again, then it's likely to be up to the same size again.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,205
Threads: 958
Joined: May 2006
#8
2015-04-29, 09:47 PM
When I empty and vacuum, I see a similar reduction but then it grows again with the next epg update. I don't see this as worth the effort, unless you want to compress a file for uploading to the forum.

Martin
Spark
Offline

Member

Posts: 106
Threads: 32
Joined: Jan 2009
#9
2015-05-03, 06:25 AM
sub Wrote:Honestly, I don't think those results are what you'd get in the real world. A lot of US users have nearly 500,000 listings, and will often have a database between 30-50MB, and that's what I'd consider normal. A database with 500,000 listings isn't going to shrink down to about 500,000 bytes. ie one byte per listing.

You'd possibly see results like this if you have a full listing database, then did an Empty EPG, then vacuumed it. As soon as you update the EPG, pulling in the listings again, then it's likely to be up to the same size again.
Actually, I did the vacuum a few days after I did a EPG update, I didn't empty anything.
I just happen to be browsing what the heck is writing to my SSD drive, and saw the NPVR database being listed... then I got curious, and ran the vacuum on it.

mvallevand Wrote:When I empty and vacuum, I see a similar reduction but then it grows again with the next epg update. I don't see this as worth the effort, unless you want to compress a file for uploading to the forum.
Yeah, doesn't seems like the database gets big enough to worry about it, though, you can still save some bytes, but, performance doesn't seem to be affected either way, at least not at the current size.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  npvr is not responding johndutcher 3 1,631 2022-05-05, 07:57 PM
Last Post: sub
  NPVR 4.2.4 Video Library No Longer Shows folder.jpg Lao Pan 12 4,215 2022-04-14, 04:33 AM
Last Post: Antmannz
  nPVR Continually Wakes PC bfos 23 11,895 2022-02-17, 03:48 PM
Last Post: sub
  Can't find tuner filter in NPVR 4.05 on old XP machine (eee 701) with RTL2832U iamanotheruser 3 1,888 2022-01-03, 04:45 AM
Last Post: mvallevand
  Streaming Services with NPVR tesla1886 4 2,911 2021-01-04, 02:58 AM
Last Post: tesla1886
  NPVR choosing incorrect xml guide display-name after reboot drlava 7 3,372 2020-12-27, 02:27 AM
Last Post: sub
  NextPVR's epg database and xml export hugo84 2 2,694 2020-05-31, 12:01 PM
Last Post: hugo84
  Can NPVR offset only 3 channel listings in EPG? acemib 20 7,491 2020-04-27, 01:28 PM
Last Post: mvallevand
  Import recorded tv shows to NPVR mattman1968 9 6,300 2020-03-03, 12:57 PM
Last Post: Jimixter
  Easiest way to migrate NPVR to a new machine JP23 1 2,074 2020-02-24, 04:55 PM
Last Post: sub

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode