亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲综合一区二区三区| 欧美一三区三区四区免费在线看| 99r国产精品| 色婷婷综合久久久| 欧美精品一二三四| 国产欧美日韩另类一区| 一级中文字幕一区二区| 69p69国产精品| 欧美电影免费观看完整版| 国产精品视频观看| 香蕉乱码成人久久天堂爱免费| 精品一二三四区| 色综合一个色综合亚洲| 日韩午夜激情免费电影| 日韩毛片视频在线看| 天堂在线亚洲视频| 丁香亚洲综合激情啪啪综合| 欧美体内she精高潮| 国产丝袜美腿一区二区三区| 亚洲午夜久久久久久久久久久| 狠狠久久亚洲欧美| 欧美探花视频资源| 国产精品视频一二三| 日韩主播视频在线| av一区二区三区| 欧美一级二级三级乱码| 亚洲男人都懂的| 国内欧美视频一区二区| 欧美日韩情趣电影| 国产精品久久久久久久久图文区| 日韩av午夜在线观看| 99国内精品久久| 久久综合色鬼综合色| 亚洲一区二区视频| 成人黄色777网| 日韩美女一区二区三区四区| 亚洲线精品一区二区三区| 高清av一区二区| 日韩欧美高清一区| 午夜亚洲国产au精品一区二区| av色综合久久天堂av综合| 26uuu久久综合| 亚洲国产精品久久久久秋霞影院| 丁香网亚洲国际| 精品欧美一区二区久久| 亚洲成人精品一区二区| 91麻豆免费看| 日本一区二区久久| 精品一区二区三区在线视频| 91精品国产麻豆| 亚洲国产精品久久人人爱| 91免费看视频| 亚洲精品视频在线| 日韩成人免费电影| 国产在线不卡视频| 777久久久精品| 樱花影视一区二区| 97国产精品videossex| 久久久国产午夜精品| 亚洲国产一区二区a毛片| 欧美日韩国产成人在线91| 奇米精品一区二区三区在线观看| 精品久久久久久久人人人人传媒| 韩国中文字幕2020精品| 国产精品网站在线| 91麻豆文化传媒在线观看| 亚洲午夜久久久久久久久电影院| 欧美高清dvd| 久久99久国产精品黄毛片色诱| 精品播放一区二区| 成人精品一区二区三区四区| 一区二区三区四区在线| 欧美一区二区三区的| 国产69精品一区二区亚洲孕妇| 最新久久zyz资源站| 欧美三级一区二区| 国模娜娜一区二区三区| 中文字幕人成不卡一区| 欧美日韩三级视频| 激情成人综合网| 中文字幕在线不卡一区 | 亚洲欧洲另类国产综合| 欧美中文字幕一二三区视频| 美女看a上一区| 国产精品久久久久久久久果冻传媒 | 亚洲三级在线免费观看| 欧美福利一区二区| 丁香天五香天堂综合| 亚洲综合激情小说| 精品国产乱码久久久久久1区2区| av一区二区三区| 免费观看成人av| 国产精品久久久久永久免费观看| 欧美日韩国产不卡| www.欧美日韩| 看片的网站亚洲| 亚洲美女少妇撒尿| 精品成人免费观看| 欧美色国产精品| 成人午夜在线免费| 天天av天天翘天天综合网| 国产精品视频九色porn| 91精品国产91久久久久久最新毛片| 成人影视亚洲图片在线| 奇米色一区二区三区四区| 成人免费在线观看入口| 欧美电视剧在线观看完整版| 91丨porny丨国产入口| 另类成人小视频在线| 一片黄亚洲嫩模| 亚洲国产精品二十页| 欧美一区日韩一区| 色综合久久88色综合天天6 | 亚洲国产裸拍裸体视频在线观看乱了| 精品国产免费一区二区三区四区 | 国产一区二区三区四区五区美女| 亚洲香肠在线观看| 国产精品成人一区二区三区夜夜夜| 欧美一级生活片| 欧美在线色视频| 成人激情视频网站| 狠狠色丁香九九婷婷综合五月| 亚洲午夜精品一区二区三区他趣| 国产精品视频麻豆| 久久亚洲一区二区三区四区| 欧美精品久久一区| 色综合天天在线| 成人性色生活片| 国内欧美视频一区二区| 日韩黄色免费网站| 亚洲成人自拍一区| 一区二区不卡在线播放 | 亚洲二区视频在线| 亚洲免费大片在线观看| 亚洲国产精品成人综合| 精品国产人成亚洲区| 日韩欧美成人激情| 欧美一区二区三区喷汁尤物| 欧美日韩美女一区二区| 欧美中文字幕不卡| 日本乱码高清不卡字幕| 91免费视频大全| 91无套直看片红桃| 91在线精品秘密一区二区| 成人精品视频一区二区三区尤物| 激情成人午夜视频| 国产精品资源在线观看| 国产在线精品一区二区三区不卡| 久草中文综合在线| 久久精品国产成人一区二区三区| 免费不卡在线观看| 麻豆精品国产传媒mv男同| 日本v片在线高清不卡在线观看| 亚洲h精品动漫在线观看| 亚洲综合激情网| 亚洲午夜激情网站| 视频一区二区中文字幕| 丝袜国产日韩另类美女| 视频在线观看一区二区三区| 日韩电影在线一区二区三区| 日本大胆欧美人术艺术动态| 日韩在线播放一区二区| 麻豆国产精品视频| 国产一区二区三区久久悠悠色av| 狠狠色丁香婷婷综合久久片| 国产真实精品久久二三区| 国产成人精品影视| 成人av网址在线| 91麻豆文化传媒在线观看| 欧美最猛黑人xxxxx猛交| 欧美日韩免费高清一区色橹橹| 欧美电影一区二区| 日韩三级电影网址| 久久网站热最新地址| 国产精品欧美久久久久无广告 | 91精品国产乱码久久蜜臀| 欧美成人精精品一区二区频| 精品电影一区二区| 国产精品色哟哟网站| 亚洲美女精品一区| 亚洲成av人片一区二区三区| 日韩av网站免费在线| 韩国女主播成人在线观看| 成人h精品动漫一区二区三区| 91浏览器入口在线观看| 欧美日韩精品系列| 精品久久久影院| 国产精品久线在线观看| 亚洲va欧美va人人爽午夜| 久久超级碰视频| 成人av电影在线| 欧美性极品少妇| 26uuu国产电影一区二区| 亚洲欧洲av一区二区三区久久| 亚洲资源在线观看| 精品无人码麻豆乱码1区2区| 波多野洁衣一区| 欧美喷潮久久久xxxxx| 欧美精品一区男女天堂| 亚洲天堂av一区|