gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
4.1KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>50.4. The PostgreSQL Rule System</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="parser-stage.html" title="50.3. The Parser Stage" /><link rel="next" href="planner-optimizer.html" title="50.5. Planner/Optimizer" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">50.4. The <span xmlns="http://www.w3.org/1999/xhtml" class="productname">PostgreSQL</span> Rule System</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="parser-stage.html" title="50.3. The Parser Stage">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="overview.html" title="Chapter 50. Overview of PostgreSQL Internals">Up</a></td><th width="60%" align="center">Chapter 50. Overview of PostgreSQL Internals</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="planner-optimizer.html" title="50.5. Planner/Optimizer">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="RULE-SYSTEM"><div class="titlepage"><div><div><h2 class="title" style="clear: both">50.4. The <span class="productname">PostgreSQL</span> Rule System</h2></div></div></div><p>
  3. <span class="productname">PostgreSQL</span> supports a powerful
  4. <em class="firstterm">rule system</em> for the specification
  5. of <em class="firstterm">views</em> and ambiguous <em class="firstterm">view updates</em>.
  6. Originally the <span class="productname">PostgreSQL</span>
  7. rule system consisted of two implementations:
  8. </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
  9. The first one worked using <em class="firstterm">row level</em> processing and was
  10. implemented deep in the <em class="firstterm">executor</em>. The rule system was
  11. called whenever an individual row had been accessed. This
  12. implementation was removed in 1995 when the last official release
  13. of the <span class="productname">Berkeley Postgres</span> project was
  14. transformed into <span class="productname">Postgres95</span>.
  15. </p></li><li class="listitem"><p>
  16. The second implementation of the rule system is a technique
  17. called <em class="firstterm">query rewriting</em>.
  18. The <em class="firstterm">rewrite system</em> is a module
  19. that exists between the <em class="firstterm">parser stage</em> and the
  20. <em class="firstterm">planner/optimizer</em>. This technique is still implemented.
  21. </p></li></ul></div><p>
  22. </p><p>
  23. The query rewriter is discussed in some detail in
  24. <a class="xref" href="rules.html" title="Chapter 40. The Rule System">Chapter 40</a>, so there is no need to cover it here.
  25. We will only point out that both the input and the output of the
  26. rewriter are query trees, that is, there is no change in the
  27. representation or level of semantic detail in the trees. Rewriting
  28. can be thought of as a form of macro expansion.
  29. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="parser-stage.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="overview.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="planner-optimizer.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">50.3. The Parser Stage </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 50.5. Planner/Optimizer</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1