tailieunhanh - Beginning PHP and Postgre SQL 8 From Novice to Professional phần 8
hệ thống PostgreSQL của bạn, bạn cần phải chạy chân không dài dòng lệnh trên mỗi cơ sở dữ liệu, và thiết lập giá trị cho tổng số các trang cho tất cả các cơ sở dữ liệu. Thiết lập này đòi hỏi max_fsm_pages 6 × byte của bộ nhớ, nhưng nó là rất quan trọng cho hiệu suất tối ưu, do đó, không đặt giá trị này quá thấp. | 598 CHAPTER 26 POSTGRESQL ADMINISTRATION your PostgreSQL system you need to run the VACUUM VERBOSE command on each database and set this value to the total number of pages for all databases. This setting requires 6 X max_fsm_pages bytes of memory but it is critical for optimum performance so don t set this value too low. This value requires a full restart of PostgreSQL for any changes to take effect. Managing Planner Resources The PostgreSQL planner is the part of PostgreSQL that determines how to execute a given query. It bases its decisions on the statistics collected via the ANALYZE command and on a handful of options in the file. Here we review the two most important options. effective_cache_size This setting tells the planner the size of the cache it can expect to be available for a single index scan. Its value is a number equal to one disk page which is normally 8 192 bytes and has a default value of 1 000 8MB RAM . A lower value suggests to the planner that using sequential scans will be favorable and a higher value suggests that an index scan will be favorable. In most cases this default is too low but determining a more appropriate setting can be difficult. The amount you want will be based on both PostgreSQL s shared_buffer setting and the kernel s disk cache available to PostgreSQL taking into account the amount other applications will take and that this amount will be shared among concurrent index scans. It is worth noting that this setting does not control the amount of cache that is available but rather is merely a suggestion to the planner and nothing more. This value requires a full restart of PostgreSQL for any changes to take effect. random_page_cost Of the settings that control planner costs this is by far the most often modified by PostgreSQL experts. This setting controls the planner s estimate of the cost of fetching nonsequential pages from disk. The measure is a number representing the multiple of the cost of a sequential .
đang nạp các trang xem trước