How to find the size of single row in crate db

How to find the size of single row i entered int crate DB. Below is my schema.
Schema
Name Type
name1 TEXT
name2 TEXT
name3 TEXT
reading1 DOUBLE
reading2 DOUBLE

When i enter a value like
(
“abcdefg”
“lmnopk”
“aksjuiopuuu”
1231231231,
1314124214
)
How to know the each text consumed bytes (size ) and entire row size in crate db ???

How to know the each text consumed bytes (size ) and entire row size in crate db ???

I’d say this isn’t really possible with CrateDB.
May I ask what you want to achieve?

The sys.shards table has the information for how much disk space is actually used for a shard. Keep in mind that this might go down, with new lucene segments being created.

1 Like

I just want to know a single row entry take how much space?.
So that i want to configure the crate yaml.

        env:
          # This is variable is detected by CrateDB.
        - name: CRATE_HEAP_SIZE
          value: "256m"
 volumeClaimTemplates:
    # Use persistent storage.
    - metadata:
        name: data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi

This is the yaml info.

you can calculated an average required disk size like this:

SELECT 
  schema_name,
  table_name,
  SUM(num_docs),
  SUM(size),
  SUM(size) / SUM(num_docs)::DOUBLE as avg_size_in_bytes
FROM sys.shards
where PRIMARY
GROUP BY 1,2
2 Likes

i am inserting 300 records in 5 minute.
that mean in an year 300 * 12 * 24 * 365=31536000.

How do i calculate the data entry ?

above query give

> schema_name	table_name	  sum(num_docs)	   sum(size)
> doc           testtable         84292        29812764

based on that for single entry 29812764 / 84292 = 353.68438286 byte

So for 1 year 11.163744 GB required?

this would be a first estimation, probably good to try testing with larger data sets.