diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-02-14 17:15:00 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-02-14 17:15:00 +0000 |
commit | ceec779ab5659665a2dae88df9631fcb7de66cd2 (patch) | |
tree | 024719b4e96049f786adc1236b75f41a8d477925 /doc/FAQ | |
parent | 3576820e7852ab20d552fe5aa7abb2847db62f6f (diff) |
Update FAQ.
Diffstat (limited to 'doc/FAQ')
-rw-r--r-- | doc/FAQ | 61 |
1 files changed, 27 insertions, 34 deletions
@@ -1,7 +1,7 @@ Frequently Asked Questions (FAQ) for PostgreSQL - Last updated: Tue Feb 12 12:18:09 EST 2002 + Last updated: Thu Feb 14 12:14:47 EST 2002 Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us) @@ -48,13 +48,11 @@ Why? 3.4) When I try to start postmaster, I get IpcSemaphoreCreate errors. Why? - 3.5) How do I prevent other hosts from accessing my PostgreSQL - database? - 3.6) Why can't I connect to my database from another machine? - 3.7) How do I tune the database engine for better performance? - 3.8) What debugging features are available? - 3.9) Why do I get "Sorry, too many clients" when trying to connect? - 3.10) What are the pg_sorttempNNN.NN files in my database directory? + 3.5) How do I control connections from other hosts? + 3.6) How do I tune the database engine for better performance? + 3.7) What debugging features are available? + 3.8) Why do I get "Sorry, too many clients" when trying to connect? + 3.9) What are the pg_sorttempNNN.NN files in my database directory? Operational Questions @@ -484,7 +482,7 @@ Administrator's Guide for more detailed information about shared memory and semaphores. - 3.5) How do I prevent other hosts from accessing my PostgreSQL database? + 3.5) How do I control connections from other hosts? By default, PostgreSQL only allows connections from the local machine using Unix domain sockets. Other machines will not be able to connect @@ -492,14 +490,7 @@ authentication by modifying the file $PGDATA/pg_hba.conf accordingly. This will allow TCP/IP connections. - 3.6) Why can't I connect to my database from another machine? - - The default configuration allows only Unix domain socket connections - from the local machine. To enable TCP/IP connections, make sure - postmaster has been started with the -i option, and add an appropriate - host entry to the file pgsql/data/pg_hba.conf. - - 3.7) How do I tune the database engine for better performance? + 3.6) How do I tune the database engine for better performance? Certainly, indexes can speed up queries. The EXPLAIN command allows you to see how PostgreSQL is interpreting your query, and which @@ -530,7 +521,7 @@ You can also use the CLUSTER command to group data in tables to match an index. See the CLUSTER manual page for more details. - 3.8) What debugging features are available? + 3.7) What debugging features are available? PostgreSQL has several features that report status information that can be valuable for debugging purposes. @@ -577,7 +568,7 @@ pgsql/data/base/dbname directory. The client profile file will be put in the client's current directory. - 3.9) Why do I get "Sorry, too many clients" when trying to connect? + 3.8) Why do I get "Sorry, too many clients" when trying to connect? You need to increase postmaster's limit on how many concurrent backend processes it can start. @@ -601,7 +592,7 @@ was 64, and changing it required a rebuild after altering the MaxBackendId constant in include/storage/sinvaladt.h. - 3.10) What are the pg_sorttempNNN.NN files in my database directory? + 3.9) What are the pg_sorttempNNN.NN files in my database directory? They are temporary files generated by the query executor. For example, if a sort needs to be done to satisfy an ORDER BY, and the sort @@ -671,29 +662,31 @@ 4.6) How much database disk space is required to store data from a typical text file? - 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.4 MB. The size of the PostgreSQL database file - containing this data can be estimated at 14 MB: + 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 characters 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.6 MB: 36 bytes: each row header (approximate) - + 8 bytes: two int fields @ 4 bytes each + 26 bytes: two int fields @ 4 bytes each + 4 bytes: pointer on page to tuple ---------------------------------------- - 48 bytes per row + 66 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 + ------------------- = 124 rows per database page (rounded down) + 66 bytes per row - 300000 data rows - -------------------- = 1755 database pages - 171 rows per page + 100000 data rows + -------------------- = 807 database pages (rounded up) + 124 rows per page -1755 database pages * 8192 bytes per page = 14,376,960 bytes (14 MB) +807 database pages * 8192 bytes per page = 6,610,944 bytes (6.6 MB) Indexes do not require as much overhead, but do contain the data that is being indexed, so they can be large also. |