Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How much database disk space is required to store data from a typical text file?

Data database disk file store text
0
Posted

How much database disk space is required to store data from a typical text file?

0

A PostgreSQL database may require up to five times the disk space to store data from a text file. As an example, consider a file of 100,000 lines with an integer and text description on each line. Suppose the text string avergages twenty bytes in length. The flat file would be 2.8 MB. The size of the PostgreSQL database file containing this data can be estimated as 6.

0

A PostgreSQL database may require up to five times the disk space to store data from a text file. As an example, consider a file of 100,000 lines with an integer and text description on each line. Suppose the text string averages twenty bytes in length. The flat file would be 2.8 MB. The size of the PostgreSQL database file containing this data can be estimated as 5.

0

A PostgreSQL database may require up to five times the disk space to store data from a text file. As an example, consider a file of 100,000 lines with an integer and text description on each line. Suppose the text string avergages twenty bytes in length. The flat file would be 2.8 MB. The size of the PostgreSQL database file containing this data can be estimated as 5.2 MB: 24 bytes: each row header (approximate) 24 bytes: one int field and one text field + 4 bytes: pointer on page to tuple ———————————– —– 52 bytes per row The data page size in PostgreSQL is 8192 bytes (8 KB), so: 8192 bytes per page ——————- = 158 rows per database page (rounded down) 52 bytes per row 100000 data rows ——————– = 633 database pages (rounded up) 158 rows per page 633 database pages * 8192 bytes per page = 5,185,536 bytes (5.2 MB) Indexes do not require as much overhead, but do contain the data that is being indexed, so they can be large also. NULLs are sto

0

A POSTGRESQL database may need six-and-a-half times the disk space required to store the data in a flat file. Consider a file of 300,000 lines with two integers on each line. The flat file is 2.4MB. The size of the POSTGRESQL database file containing this data can be estimated at 14MB: 36 bytes: each row header (approximate) + 8 bytes: two int fields @ 4 bytes each + 4 bytes: pointer on page to tuple —————————————- 48 bytes per row The data page size in PostgreSQL is 8192 bytes (8 KB), so: 8192 bytes per page ——————- = 171 rows per database page (rounded up) 48 bytes per row 300000 data rows ——————– = 1755 database pages 171 rows per page 1755 database pages * 8192 bytes per page = 14,376,960 bytes (14MB) Indexes do not require as much overhead, but do contain the data that is being indexed, so they can be large also.

0

PostgreSQL database may require up to five times the disk space to store data from a text file. As an example, consider a file of 100,000 lines with an integer and text description on each line. Suppose the text string avergages twenty bytes in length. The flat file would be 2.8 MB. The size of the PostgreSQL database file containing this data can be estimated as 5.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123