Re: [sqlite] Possible to get table size (in bytes)?

2015-02-05 Thread Rael Bauer
Thanks to the reference to the sqlite_analyzer. That is very 
interesting. (And the manual counting of bytes would also help me for my 
question..)


The main question I have is how expensive will adding an fts4aux table be?

I noticed the report for a FTS table e.g. NOTES_FTS

only shows results for:
NOTES_FTS_SEGMENTS
NOTES_FTS_CONTENT
NOTES_FTS_SEGDIR

Why not for NOTES_FTS - is that just a view?

Thanks
Rael
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Possible to get table size (in bytes)?

2015-02-04 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/04/2015 10:26 AM, Rael Bauer wrote:
> Is it possible to get the information of how many bytes a table is 
> taking up in the database?

What is the underlying problem you are trying to solve with this
information?  There may be alternate approaches that work better.

How often do you want the size (eg a one off, checked every few minutes)?

Roger

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iEYEARECAAYFAlTSsNoACgkQmOOfHg372QS+VgCguwbCzace81zpwYNueblRu0Qj
85AAnR0XRX4Mw8DBlgu2Tfq04+/ng5Nc
=7HiF
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Possible to get table size (in bytes)?

2015-02-04 Thread RSmith


On 2015/02/04 20:26, Rael Bauer wrote:

Hi,

Is it possible to get the information of how many bytes a table is taking up in 
the database?


Not with API calls, but it is possible by running the SQLiteAnalyzer utility 
afvailable from the same download pages as SQLite3 CLI etc.
http://www.sqlite.org/download.html

In the output which the analyzer produces, you can find the space taken up by any table or index, also the total pages ofr tables 
and the bytes payload (which is the actual amount of data, I believe what you are looking for?) among a myriad of other data 
properties and measurements.


 Also, you can load the output as a script which would add a table to your database storing all this info - but it is of course 
only updated once the analyzer is run again.





___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Possible to get table size (in bytes)?

2015-02-04 Thread Simon Slavin

On 4 Feb 2015, at 6:49pm, Stephen Chrzanowski  wrote:

> I can't be certain if a
> single page contains multiple types of data such as table AND index
> information.

In a SQLite file, each page is assigned to header information or to a specific 
table or index.  No mixed use.

However I agree with your conclusion: there's no way to get filesize 
information using just SQLite calls.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Possible to get table size (in bytes)?

2015-02-04 Thread Stephen Chrzanowski
Wrong answer.

He's asking how many bytes a table takes up within the database.  That
would depend on a whole lot of factors including what is stored, the number
of fields, etc.

Is there SQL code to get requested result?

Short answer, No.  Not easily.

Long answer, a table isn't a certain number of bytes.  A page is a fixed
size, but a page may contain table data, or the page may contain index
data, or the page may contain other information.  I can't be certain if a
single page contains multiple types of data such as table AND index
information.

The best bet to calculate the number of bytes in a table is to find out
what field types you're using in your table, and if variable length strings
or blobs are within the dataset, then you need to count each byte for each
field for each row, taking in to account unicode if req'd.  Then you need
to include header information per row and per page for an accurate result.

On Wed, Feb 4, 2015 at 1:34 PM, Simon Davies 
wrote:

> On 4 February 2015 at 18:26, Rael Bauer  wrote:
> > Hi,
> >
> > Is it possible to get the information of how many bytes a table is
> taking up
> > in the database?
>
> For Windows, see http://www.sqlite.org/download.html#a10
> There are other links for other operating systems
>
> > Thanks
> > Rael
>
> Regards,
> Simon
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Possible to get table size (in bytes)?

2015-02-04 Thread Simon Davies
On 4 February 2015 at 18:26, Rael Bauer  wrote:
> Hi,
>
> Is it possible to get the information of how many bytes a table is taking up
> in the database?

For Windows, see http://www.sqlite.org/download.html#a10
There are other links for other operating systems

> Thanks
> Rael

Regards,
Simon
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Possible to get table size (in bytes)?

2015-02-04 Thread Rael Bauer

Hi,

Is it possible to get the information of how many bytes a table is 
taking up in the database?


Thanks
Rael
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users