what is the unit of SQLITE_STATUS_MEMORY_USED?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

what is the unit of SQLITE_STATUS_MEMORY_USED?

smallboatca@yahoo.com
Hi,


I am using   sqlite_status = sqlite3_status(SQLITE_STATUS_MEMORY_USED, &pCurrent, &pHighwater, resetFlag);
to get the memory used by sqlite.


What is the memory unit for pCurrent (the max sqlite memory used)?

Is it in bytes, bit or something else?


Thanks

Joe

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: what is the unit of SQLITE_STATUS_MEMORY_USED?

Dan Kennedy-4
On 12/17/2011 06:16 AM, smallboat wrote:

> Hi,
>
>
> I am using   sqlite_status = sqlite3_status(SQLITE_STATUS_MEMORY_USED,&pCurrent,&pHighwater, resetFlag);
> to get the memory used by sqlite.
>
>
> What is the memory unit for pCurrent (the max sqlite memory used)?
>
> Is it in bytes, bit or something else?

Bytes.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: what is the unit of SQLITE_STATUS_MEMORY_USED?

smallboatca@yahoo.com
Hi, Dan:


Do you have or know some wiki or documents about this? I want to know more about it.


It is the sum of the allocation
sizes as reported by the xSize method in sqlite3_mem_methods , based on http://www.sqlite.org/c3ref/c_status_malloc_size.html.
Does it mean it depend son what the allocation size is?


Thank you for your reply and help.


Regards,
Jun



----- Original Message -----
From: Dan Kennedy <[hidden email]>
To: [hidden email]
Cc:
Sent: Friday, December 16, 2011 8:56 PM
Subject: Re: [sqlite] what is the unit of SQLITE_STATUS_MEMORY_USED?

On 12/17/2011 06:16 AM, smallboat wrote:

> Hi,
>
>
> I am using   sqlite_status = sqlite3_status(SQLITE_STATUS_MEMORY_USED,&pCurrent,&pHighwater, resetFlag);
> to get the memory used by sqlite.
>
>
> What is the memory unit for pCurrent (the max sqlite memory used)?
>
> Is it in bytes, bit or something else?

Bytes.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: what is the unit of SQLITE_STATUS_MEMORY_USED?

Simon Slavin-3

On 17 Dec 2011, at 5:02am, smallboat wrote:

> Do you have or know some wiki or documents about this? I want to know more about it.
>
>
> It is the sum of the allocation
> sizes as reported by the xSize method in sqlite3_mem_methods , based onhttp://www.sqlite.org/c3ref/c_status_malloc_size.html.
> Does it mean it depend son what the allocation size is?

Each time SQLite calls malloc() it has to specify how many bytes of memory it wants.  The value you're getting back from sqlite3_status() is the total number of bytes malloc() has delivered to SQLite.

(Answer simplified because SQLite also releases memory while it's working.)

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

command line to get number of tables in sqlite

smallboatca@yahoo.com
In reply to this post by smallboatca@yahoo.com
Hello,

I have a sqlite file. I would like to open it and know how many tables in it.

What is the command line to open a sqlite file and get to know how many tables in it? Thanks.

Regards,
Joe

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: command line to get number of tables in sqlite

Tim Streater-3
On 21 Dec 2011 at 18:32, smallboat <[hidden email]> wrote:

> I have a sqlite file. I would like to open it and know how many tables in it.
>
> What is the command line to open a sqlite file and get to know how many tables
> in it? Thanks.

See:

http://www.sqlite.org/sqlite.html

and:

http://www.sqlite.org/faq.html#q7

--
Cheers  --  Tim

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: command line to get number of tables in sqlite

Roger Andersson-2
In reply to this post by smallboatca@yahoo.com
Somthing like
sqlite3  sqlite.file
sqlite> select count(*) from sqlite_master where type = 'table';

/Roger
On 12/21/11 19:32, smallboat wrote:
> Hello,
>
> I have a sqlite file. I would like to open it and know how many tables in it.
>
> What is the command line to open a sqlite file and get to know how many tables in it? Thanks.
>
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: command line to get number of tables in sqlite

Matt Young-5
In reply to this post by smallboatca@yahoo.com
select count() from sqlite_master;

No??

On Wed, Dec 21, 2011 at 10:32 AM, smallboat <[hidden email]> wrote:

> Hello,
>
> I have a sqlite file. I would like to open it and know how many tables in
> it.
>
> What is the command line to open a sqlite file and get to know how many
> tables in it? Thanks.
>
> Regards,
> Joe
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: command line to get number of tables in sqlite

Mohit Sindhwani-5
On 22/12/2011 7:25 AM, Matt Young wrote:
> select count() from sqlite_master;
>
> No??
...where type='table';




Cheers,
Mohit.
22/12/2011 | 12:51 PM.

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users