Re: [EXTERNAL] Re: Row length in SQLITE

Hick Gunter <hick-p6o8VmWS/[email protected]>
Newsgroups gmane.comp.db.sqlite.general
Message-ID <78a618cf7f1b415241ef7ac657d1dac70fa9b2d8@localhost>
As previously mentioned, SQLite uses a compressed format to store rows. You would have to reverse engineer at least the calculation

-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:[email protected]] Im Auftrag von Deon Brewis
Gesendet: Samstag, 25. Januar 2020 05:14
An: SQLite mailing list <[email protected]>
Betreff: [EXTERNAL] Re: [sqlite] Row length in SQLITE

No I mean e.g.

row 1 = 500 bytes,
row 2 = 600 bytes
row 3 = 80 bytes
row 4 = 300 bytes

etc.

Like the info that DBSTAT gives, but per row, not per page. This doesn't need to be performant - it's for usage analysis during development time.

- Deon

-----Original Message-----
From: sqlite-users <[email protected]> On Behalf Of Simon Slavin
Sent: Wednesday, January 22, 2020 5:24 PM
To: SQLite mailing list <[email protected]>
Subject: Re: [sqlite] Row length in SQLITE

On 22 Jan 2020, at 11:44pm, Deon Brewis <[email protected]> wrote:

> Is there any way to get the length of rows in a table / index in sqlite?

Do you mean the count of rows in a table / index ?

   SELECT count(*) FROM MyTable

There's no easy fast way to do this because SQLite doesn't keep that number handy anywhere.  It stores the entries in a tree and it would have to manually count the leaves of the tree.

----

Or do you mean the count of columns in a table / index ?

    SELECT * FROM MyTable LIMIT 1

and count the number of columns returned.  Or in C

    sqlite3_column_count()
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.