Why does the DB contain two identical tables?

Started by smankusors

Why does the DB contain two identical tables?   03 May 2016, 21:56

Hello,
I lost my computer, and I lost my data usage too. Fortunately I have a backup, and I'm planning to simulate the data usage.
But I found something that I don't understand...
Why the DB contains "total_usage" and "total_usage_with_status"? Why not just... merge them? What is the meaning of "status" column?

Thanks,
Antony Kurniawan
SoftPerfect Support forum - Andrew avatar image

Re: Why does the DB contain two identical tables?   03 May 2016, 23:45

Those are not tables, they are called views. They occupy very little disk space and don't contain any data.

The reason there are two is that total_usage is executed faster than total_usage_with_status where NetWorx only fetches the total usage and doesn't need the status.

The status is the 'hour status' assigned by the user to that hour in the Advanced Settings:
  • Peak hour, when traffic is classed as on-peak.
  • Non-peak hour, when traffic is classed as off-peak.
  • Ignored hour, when traffic is disregarded.

Re: Why does the DB contain two identical tables?   04 May 2016, 01:57

Ouh... I think they have the same execution time... ._.
OK... So this is not easier than editing the XML...
Currently the last date on my database is Jan 6th 2016. I want to add 300GB data usage to the database up to April 27th 2016. What should I do?

Thanks
SoftPerfect Support forum - Andrew avatar image

Re: Why does the DB contain two identical tables?   04 May 2016, 12:16

Assuming you are already using something to open the database file, just run this statement. It will add 300GB of incoming traffic to user John Smith dated April 27, 2016:
INSERT OR REPLACE INTO usage (USER_NAME, DAY, HOUR, DATA_IN, DATA_OUT, DIALUP_DURATION)
VALUES ('John Smith', cast(julianday('2016-04-27')-julianday('1899-12-30') as integer), 0, 322122547200, 0, 0);

Re: Why does the DB contain two identical tables?   04 May 2016, 15:44

Only usage? How about total_usage, total_usage_with_status, and usage_with_status? shocked or surprised
SoftPerfect Support forum - Andrew avatar image

Re: Why does the DB contain two identical tables?   04 May 2016, 15:49

Like I explained, those are not tables but views. You can't add anything there because there is no data in them.

Re: Why does the DB contain two identical tables?   04 May 2016, 15:53

Wait wait wait... How views.... work? shocked or surprised

EDIT : ouh sorry didn't read the wikipedia link lel xD

Re: Why does the DB contain two identical tables?   05 May 2016, 03:37

Wait a second... When I tried to restore from usage report... The applications tab seems missing... Kind of reset...
But the other data seems fine
SoftPerfect Support forum - Andrew avatar image

Re: Why does the DB contain two identical tables?   05 May 2016, 10:11

What exactly do you mean by ''restoring from usage report"?

Re: Why does the DB contain two identical tables?   05 May 2016, 15:38

I mean restore button from Usage Report dialog
SoftPerfect Support forum - Andrew avatar image

Re: Why does the DB contain two identical tables?   05 May 2016, 19:35

It's a full backup, it restores everything that went in it.

Re: Why does the DB contain two identical tables?   09 May 2016, 03:06

Oh nevermind, silly me, I forgot that there is no data before that day ._.
Btw, I changed the drive letter of my programs from P: to A:, how to... Change the existing path on the data? o_O"

Reply to this topic

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 **         ******   ********   *******   **    ** 
 **        **    **  **        **     **  ***   ** 
 **        **        **               **  ****  ** 
 **        **        ******     *******   ** ** ** 
 **        **        **               **  **  **** 
 **        **    **  **        **     **  **   *** 
 ********   ******   ********   *******   **    ** 

Message: