亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? perform.sgml

?? PostgreSQL7.4.6 for Linux
?? SGML
?? 第 1 頁 / 共 3 頁
字號:
<!--$Header: /cvsroot/pgsql/doc/src/sgml/perform.sgml,v 1.37 2003/11/01 01:56:29 petere Exp $--> <chapter id="performance-tips">  <title>Performance Tips</title>  <para>   Query performance can be affected by many things. Some of these can    be manipulated by the user, while others are fundamental to the underlying   design of the system.  This chapter provides some hints about understanding   and tuning <productname>PostgreSQL</productname> performance.  </para>  <sect1 id="using-explain">   <title>Using <command>EXPLAIN</command></title>   <indexterm zone="using-explain">    <primary>EXPLAIN</primary>   </indexterm>   <indexterm zone="using-explain">    <primary>query plan</primary>   </indexterm>   <para>    <productname>PostgreSQL</productname> devises a <firstterm>query    plan</firstterm> for each query it is given.  Choosing the right    plan to match the query structure and the properties of the data    is absolutely critical for good performance.  You can use the    <command>EXPLAIN</command> command to see what query plan the system    creates for any query.    Plan-reading is an art that deserves an extensive tutorial, which    this is not; but here is some basic information.   </para>   <para>    The numbers that are currently quoted by <command>EXPLAIN</command> are:    <itemizedlist>     <listitem>      <para>       Estimated start-up cost (Time expended before output scan can start,       e.g., time to do the sorting in a sort node.)      </para>     </listitem>     <listitem>      <para>       Estimated total cost (If all rows were to be retrieved, which they may not       be: a query with a <literal>LIMIT</> clause will stop short of paying the total cost,       for example.)      </para>     </listitem>     <listitem>      <para>       Estimated number of rows output by this plan node (Again, only if       executed to completion)      </para>     </listitem>     <listitem>      <para>       Estimated average width (in bytes) of rows output by this plan       node      </para>     </listitem>    </itemizedlist>   </para>   <para>    The costs are measured in units of disk page fetches.  (CPU effort    estimates are converted into disk-page units using some    fairly arbitrary fudge factors. If you want to experiment with these    factors, see the list of run-time configuration parameters in    <xref linkend="runtime-config-resource">.)   </para>   <para>    It's important to note that the cost of an upper-level node includes    the cost of all its child nodes.  It's also important to realize that    the cost only reflects things that the planner/optimizer cares about.    In particular, the cost does not consider the time spent transmitting    result rows to the frontend, which could be a pretty dominant    factor in the true elapsed time; but the planner ignores it because    it cannot change it by altering the plan.  (Every correct plan will    output the same row set, we trust.)   </para>   <para>    Rows output is a little tricky because it is <emphasis>not</emphasis> the    number of rows    processed/scanned by the query, it is usually less, reflecting the    estimated selectivity of any <literal>WHERE</>-clause conditions that are being    applied at this node.  Ideally the top-level rows estimate will    approximate the number of rows actually returned, updated, or deleted    by the query.   </para>   <para>    Here are some examples (using the regression test database after a    <literal>VACUUM ANALYZE</>, and 7.3 development sources):<programlisting>EXPLAIN SELECT * FROM tenk1;                         QUERY PLAN------------------------------------------------------------- Seq Scan on tenk1  (cost=0.00..333.00 rows=10000 width=148)</programlisting>   </para>   <para>    This is about as straightforward as it gets.  If you do<programlisting>SELECT * FROM pg_class WHERE relname = 'tenk1';</programlisting>    you will find out that <classname>tenk1</classname> has 233 disk    pages and 10000 rows.  So the cost is estimated at 233 page    reads, defined as costing 1.0 apiece, plus 10000 * <varname>cpu_tuple_cost</varname> which is    currently 0.01 (try <command>SHOW cpu_tuple_cost</command>).   </para>   <para>    Now let's modify the query to add a <literal>WHERE</> condition:<programlisting>EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 1000;                         QUERY PLAN------------------------------------------------------------ Seq Scan on tenk1  (cost=0.00..358.00 rows=1033 width=148)   Filter: (unique1 &lt; 1000)</programlisting>    The estimate of output rows has gone down because of the <literal>WHERE</> clause.    However, the scan will still have to visit all 10000 rows, so the cost    hasn't decreased; in fact it has gone up a bit to reflect the extra CPU    time spent checking the <literal>WHERE</> condition.   </para>   <para>    The actual number of rows this query would select is 1000, but the    estimate is only approximate.  If you try to duplicate this experiment,    you will probably get a slightly different estimate; moreover, it will    change after each <command>ANALYZE</command> command, because the    statistics produced by <command>ANALYZE</command> are taken from a    randomized sample of the table.   </para>   <para>    Modify the query to restrict the condition even more:<programlisting>EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 50;                                   QUERY PLAN------------------------------------------------------------------------------- Index Scan using tenk1_unique1 on tenk1  (cost=0.00..179.33 rows=49 width=148)   Index Cond: (unique1 &lt; 50)</programlisting>    and you will see that if we make the <literal>WHERE</> condition selective    enough, the planner will    eventually decide that an index scan is cheaper than a sequential scan.    This plan will only have to visit 50 rows because of the index,    so it wins despite the fact that each individual fetch is more expensive    than reading a whole disk page sequentially.   </para>   <para>    Add another condition to the <literal>WHERE</> clause:<programlisting>EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 50 AND stringu1 = 'xxx';                                  QUERY PLAN------------------------------------------------------------------------------- Index Scan using tenk1_unique1 on tenk1  (cost=0.00..179.45 rows=1 width=148)   Index Cond: (unique1 &lt; 50)   Filter: (stringu1 = 'xxx'::name)</programlisting>    The added condition <literal>stringu1 = 'xxx'</literal> reduces the    output-rows estimate, but not the cost because we still have to visit the    same set of rows.  Notice that the <literal>stringu1</> clause    cannot be applied as an index condition (since this index is only on    the <literal>unique1</> column).  Instead it is applied as a filter on    the rows retrieved by the index.  Thus the cost has actually gone up    a little bit to reflect this extra checking.   </para>   <para>    Let's try joining two tables, using the columns we have been discussing:<programlisting>EXPLAIN SELECT * FROM tenk1 t1, tenk2 t2 WHERE t1.unique1 &lt; 50 AND t1.unique2 = t2.unique2;                               QUERY PLAN---------------------------------------------------------------------------- Nested Loop  (cost=0.00..327.02 rows=49 width=296)   -&gt;  Index Scan using tenk1_unique1 on tenk1 t1                                      (cost=0.00..179.33 rows=49 width=148)         Index Cond: (unique1 &lt; 50)   -&gt;  Index Scan using tenk2_unique2 on tenk2 t2                                      (cost=0.00..3.01 rows=1 width=148)         Index Cond: ("outer".unique2 = t2.unique2)</programlisting>   </para>   <para>    In this nested-loop join, the outer scan is the same index scan we had    in the example before last, and so its cost and row count are the same    because we are applying the <literal>WHERE</> clause <literal>unique1 &lt; 50</literal> at that node.    The <literal>t1.unique2 = t2.unique2</literal> clause is not relevant yet, so it doesn't    affect row count of the outer scan.  For the inner scan, the <literal>unique2</> value of the    current    outer-scan row is plugged into the inner index scan    to produce an index condition like    <literal>t2.unique2 = <replaceable>constant</replaceable></literal>.  So we get the     same inner-scan plan and costs that we'd get from, say, <literal>EXPLAIN SELECT     * FROM tenk2 WHERE unique2 = 42</literal>.  The costs of the loop node are then set     on the basis of the cost of the outer scan, plus one repetition of the     inner scan for each outer row (49 * 3.01, here), plus a little CPU     time for join processing.   </para>   <para>    In this example the join's output row count is the same as the product    of the two scans' row counts, but that's not true in general, because    in general you can have <literal>WHERE</> clauses that mention both tables and    so can only be applied at the join point, not to either input scan.    For example, if we added <literal>WHERE ... AND t1.hundred &lt; t2.hundred</literal>,    that would decrease the output row count of the join node, but not change    either input scan.   </para>   <para>    One way to look at variant plans is to force the planner to disregard    whatever strategy it thought was the winner, using the enable/disable    flags for each plan type.  (This is a crude tool, but useful.  See

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本成人在线不卡视频| 色婷婷国产精品久久包臀| 懂色av一区二区夜夜嗨| 欧美日本一区二区三区| 中文字幕欧美区| 久草热8精品视频在线观看| 91色porny| 国产精品妹子av| 六月丁香综合在线视频| 欧美最猛性xxxxx直播| 国产肉丝袜一区二区| 美女被吸乳得到大胸91| 欧美在线看片a免费观看| 国产精品欧美一区二区三区| 久久99国产精品尤物| 91精品国产91久久久久久一区二区 | 日韩国产精品大片| 欧美中文字幕一二三区视频| 中文字幕精品三区| 国产美女主播视频一区| 欧美成人一区二区三区在线观看| 亚洲bt欧美bt精品777| 欧美亚洲动漫另类| 亚洲精品国久久99热| 91在线免费播放| 国产精品久久久久影院亚瑟| 国产成人av一区二区| 国产亚洲一区二区三区在线观看 | 日韩欧美亚洲一区二区| 免费视频一区二区| 日韩精品一区国产麻豆| 美腿丝袜亚洲三区| 精品三级av在线| 久久99精品一区二区三区三区| 国产精品国产三级国产专播品爱网 | 欧美国产精品一区二区三区| 久久草av在线| 26uuu国产电影一区二区| 国产精品亚洲午夜一区二区三区 | 麻豆91小视频| 精品国产免费人成电影在线观看四季 | 久久综合久久综合久久综合| 久久电影网电视剧免费观看| 欧美第一区第二区| 豆国产96在线|亚洲| 一区二区三区影院| 国产剧情一区二区三区| 亚洲二区在线视频| 欧美亚洲精品一区| 男人的j进女人的j一区| 欧美大片拔萝卜| 国产精品久久久久婷婷| 国产69精品久久久久777| 国产精品激情偷乱一区二区∴| 白白色 亚洲乱淫| 尤物视频一区二区| 精品日韩在线观看| 国产精品夜夜嗨| 国产精品电影院| 色婷婷av一区二区| 午夜欧美大尺度福利影院在线看| 日韩一区二区精品在线观看| 寂寞少妇一区二区三区| 国产精品福利一区二区| 欧美亚洲国产一区二区三区va | 欧美videossexotv100| 国产寡妇亲子伦一区二区| 亚洲激情自拍视频| 欧美成人激情免费网| 96av麻豆蜜桃一区二区| 日韩激情中文字幕| 国产精品嫩草影院com| 在线视频欧美精品| 精品一区二区免费看| 国产精品一区久久久久| 一二三四区精品视频| 精品国产免费视频| 欧美日韩亚洲不卡| 懂色av中文字幕一区二区三区| 婷婷六月综合亚洲| 亚洲精品一二三四区| 日韩欧美中文一区二区| 色婷婷久久久亚洲一区二区三区| 日韩精品电影一区亚洲| 中文字幕一区二区不卡| 欧美日韩精品一区二区| 日本视频中文字幕一区二区三区 | 欧美日韩综合色| 亚洲夂夂婷婷色拍ww47| 欧美一区二区三区在线| 成人高清在线视频| 精品一区二区久久| 丝瓜av网站精品一区二区| 国产精品久久久久久福利一牛影视 | 中文无字幕一区二区三区| 欧美日韩久久久一区| 97成人超碰视| 风间由美一区二区av101 | 五月天精品一区二区三区| 国产午夜精品久久久久久免费视 | 中文字幕一区二区日韩精品绯色| 日韩三区在线观看| 欧美日韩精品福利| 国产精品久久久久久久久免费相片 | 国产精品久久久久永久免费观看| 精品国产一区二区在线观看| 91精品国产乱| 91精品国产综合久久久久久 | 久久久久久久久97黄色工厂| 欧美一区二区三区不卡| 91麻豆精品国产91久久久更新时间| 色av一区二区| 色婷婷综合久久久中文字幕| www.性欧美| 91一区二区三区在线播放| 成人激情图片网| 99久久99久久免费精品蜜臀| 成人av电影免费在线播放| 成人一区在线观看| 成a人片亚洲日本久久| www.欧美.com| av成人免费在线| 色av综合在线| 欧美高清www午色夜在线视频| 欧美高清视频www夜色资源网| 5858s免费视频成人| 精品久久久久久久久久久久包黑料| 9191成人精品久久| 久久丝袜美腿综合| 国产精品初高中害羞小美女文| 国产精品久久久久影院色老大 | 色94色欧美sute亚洲线路二| 色综合激情久久| 7777精品伊人久久久大香线蕉 | 69成人精品免费视频| 欧美成人精品1314www| 国产拍揄自揄精品视频麻豆| 亚洲国产精品黑人久久久| 国产精品高潮久久久久无| 亚洲综合一区二区三区| 日本亚洲天堂网| 国产电影一区二区三区| 色天使久久综合网天天| 欧美狂野另类xxxxoooo| 久久久www免费人成精品| 亚洲图片你懂的| 日韩在线一区二区| 国产激情一区二区三区桃花岛亚洲| heyzo一本久久综合| 欧美高清视频www夜色资源网| 久久久国产精品麻豆| 午夜精品福利视频网站| 国产馆精品极品| 欧美猛男gaygay网站| 欧美高清在线一区| 午夜精品久久久| www.在线欧美| 久久亚洲二区三区| 亚洲成国产人片在线观看| 国产东北露脸精品视频| 欧美精品久久一区二区三区| 国产女人18毛片水真多成人如厕| 午夜精品免费在线观看| 91在线精品一区二区三区| 91麻豆精品国产91久久久久久| 中文字幕欧美日韩一区| 久久综合综合久久综合| 欧美在线一区二区三区| 国产欧美日韩卡一| 美女视频一区二区三区| 欧美亚洲一区二区在线| 中文字幕av不卡| 韩国精品久久久| 欧美精品v国产精品v日韩精品| 综合激情网...| 国产99久久久国产精品潘金| 精品少妇一区二区三区在线播放 | 亚洲精品一区在线观看| 亚洲国产综合91精品麻豆| 9久草视频在线视频精品| 2014亚洲片线观看视频免费| 亚洲国产cao| 色婷婷精品久久二区二区蜜臀av| 久久久久久一二三区| 青娱乐精品视频| 欧美精品1区2区| 亚洲二区在线观看| 欧美日韩三级一区二区| 亚洲日本成人在线观看| www.av亚洲| 国产精品家庭影院| 99久久久精品| 亚洲欧美在线观看| 97久久精品人人做人人爽50路| 国产精品久久久久天堂| 暴力调教一区二区三区| 亚洲日本丝袜连裤袜办公室| 91欧美一区二区| 一区二区三区资源| 色欧美片视频在线观看 |