|
14 | 14 | alink="#0000ff"> |
15 | 15 | <H1>Frequently Asked Questions (FAQ) for PostgreSQL</H1> |
16 | 16 |
|
17 | | -<P>Last updated:Thu Feb14 12:14:47 EST 2002</P> |
| 17 | +<P>Last updated:Mon Feb18 00:08:54 EST 2002</P> |
18 | 18 |
|
19 | 19 | <P>Current maintainer: Bruce Momjian (<Ahref= |
20 | 20 | "mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>)<BR> |
@@ -855,27 +855,27 @@ <H4><A name="4.6">4.6</A>) How much database disk space is required |
855 | 855 |
|
856 | 856 | <P>As an example, consider a file of 100,000 lines with an integer |
857 | 857 | and text description on each line. Suppose the text string avergages |
858 | | - twentycharacters in length. The flat file would be 2.8 MB. The size |
| 858 | + twentybytes in length. The flat file would be 2.8 MB. The size |
859 | 859 | of the PostgreSQL database file containing this data can be |
860 | | - estimated as 6.6 MB:</P> |
| 860 | + estimated as 6.4 MB:</P> |
861 | 861 | <PRE> |
862 | 862 | 36 bytes: each row header (approximate) |
863 | | -26 bytes:two intfields @ 4 bytes each |
| 863 | +24 bytes:one intfield and one text filed |
864 | 864 | + 4 bytes: pointer on page to tuple |
865 | 865 | ---------------------------------------- |
866 | | -66 bytes per row |
| 866 | +64 bytes per row |
867 | 867 |
|
868 | 868 | The data page size in PostgreSQL is 8192 bytes (8 KB), so: |
869 | 869 |
|
870 | 870 | 8192 bytes per page |
871 | | - ------------------- =124 rows per database page (rounded down) |
872 | | -66 bytes per row |
| 871 | + ------------------- =128 rows per database page (rounded down) |
| 872 | +64 bytes per row |
873 | 873 |
|
874 | 874 | 100000 data rows |
875 | | - -------------------- =807 database pages (rounded up) |
876 | | -124 rows per page |
| 875 | + -------------------- =782 database pages (rounded up) |
| 876 | +128 rows per page |
877 | 877 |
|
878 | | -807 database pages * 8192 bytes per page = 6,610,944 bytes (6.6 MB) |
| 878 | +782 database pages * 8192 bytes per page = 6,406,144 bytes (6.4 MB) |
879 | 879 | </PRE> |
880 | 880 |
|
881 | 881 | <P>Indexes do not require as much overhead, but do contain the data |
|