Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6328893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:32:45+00:00 2026-05-24T17:32:45+00:00

I have the following questions regarding BLOBs in sqlite: Does sqlite keep track of

  • 0

I have the following questions regarding BLOBs in sqlite:

  • Does sqlite keep track of sizes of BLOBs?
  • I’m guessing that it does, but then, does the length function use it, or does it read the BLOB’s content?
  • If sqlite keeps track of the size of the BLOB and length doesn’t use it, is the size accessible via some other functionality?

I’m asking this because I’m wondering if I should implement triggers that set BLOBs’ sizes in additional columns, of if I can obtain the sizes dynamically without the performance hit of sqlite reading the BLOBs.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:32:47+00:00Added an answer on May 24, 2026 at 5:32 pm

    From the source:

    ** In an SQLite index record, the serial type is stored directly before
    ** the blob of data that it corresponds to. In a table record, all serial
    ** types are stored at the start of the record, and the blobs of data at
    ** the end. Hence these functions allow the caller to handle the
    ** serial-type and data blob seperately.
    **
    ** The following table describes the various storage classes for data:
    **
    **   serial type        bytes of data      type
    **   --------------     ---------------    ---------------
    **      0                     0            NULL
    **      1                     1            signed integer
    **      2                     2            signed integer
    **      3                     3            signed integer
    **      4                     4            signed integer
    **      5                     6            signed integer
    **      6                     8            signed integer
    **      7                     8            IEEE float
    **      8                     0            Integer constant 0
    **      9                     0            Integer constant 1
    **     10,11                               reserved for expansion
    **    N>=12 and even       (N-12)/2        BLOB
    **    N>=13 and odd        (N-13)/2        text
    

    In other words, the blob size is in the serial, and it’s length is simply “(serial_type-12)/2”.
    This serial is stored before the actual blob, so you don’t need to read the blob to get its size.
    Call sqlite3_blob_open and then sqlite3_blob_bytes to get this value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen many articles and Questions/Answers Regarding Lock Escalation but following things are
I have some questions regarding Max() What does the following query mean? SELECT MAX(X)
I have been repeatedly asked the following questions in many interviews.... But still can't
I have installed 64 bits RHEL. I have following questions regarding ant.jar for the
I realise that there are many existing questions regarding this issue, but I haven't
(Note: I have seen several questions regarding .NET logging frameworks, but haven't seen any
I have seen a lot of questions here regarding the Facebook Graph API but
I have two questions regarding array: First one is regarding following code: int a[30];
I have two questions regarding client-side validation in ASP, relating to the following setup:
The following code should be self explanatory. I have two questions regarding the used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.