home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre2.z / postgre2 / ref / fastpath < prev    next >
Encoding:
Text File  |  1992-08-27  |  2.1 KB  |  68 lines

  1. .\" XXX standard disclaimer belongs here....
  2. .\" $Header: /private/postgres/ref/RCS/fastpath,v 1.8 1992/07/14 05:54:17 ptong Exp $
  3. .SS "FAST PATH" 6/14/90
  4. .XA 0 "Section 6 \*- Fast Path"
  5. .sp 2i
  6. .ps 14
  7. .ce
  8. .b "SECTION 6 \*- FAST PATH"
  9. .sp 3
  10. .uh NAME
  11. .lp
  12. fast path \*- trap door into system internals
  13. .uh SYNOPSIS
  14. .lp
  15. .(l
  16. .q "retrieve (retval = function([ arg { , arg } ] )"
  17. .)l
  18. .uh DESCRIPTION
  19. .lp
  20. \*(PP allows any valid \*(PP function to be called in this way.  Prior
  21. implementations of 
  22. .b fast
  23. .b path
  24. allowed user functions to be called directly.  For now, the above syntax should
  25. be used, with arguments cast into the appropriate types.  By executing the
  26. above type of query, control transfers completely to the user function; any
  27. user function can access any \*(PP function or any global variable in the
  28. \*(PP address space.
  29. .sp
  30. There are six levels at which calls can be performed:
  31. .sp
  32. .nf
  33. 1)    Traffic cop level
  34.     If a function wants to execute a \*(PP command and pass a string
  35.     representation, this level is appropriate.
  36. .sp
  37. 2)    Parser
  38.     A function can access the \*(PP parser, passing a string and
  39.     getting a parse tree in return.
  40. .sp
  41. 3)    Query optimizer
  42.     A function can call the query optimizer, passing it a parse tree
  43.     and obtaining a query plan in return.
  44. .sp
  45. 4)    Executor
  46.     A function can call the executor and pass it a query plan to be executed.
  47. .sp
  48. 5)    Access methods
  49.     A function can directly call the access methods if it wishes.
  50. .sp
  51. 6)    Function manager
  52.     A function can call other functions using this level.
  53. .fi
  54. .sp
  55. Documentation of layers 1-6 will appear
  56. at some future time.
  57. Meanwhile, fast path users must consult the source code
  58. for function names and arguments at each level.
  59. .lp
  60. It should be noted that users who are concerned with ultimate performance
  61. can bypass the query language completely and directly call functions that
  62. in turn interact with the access methods.
  63. On the other hand, a user can implement a new query language by coding
  64. a function with an internal parser that then calls the \*(PP
  65. optimizer and executor.
  66. Complete flexibility to use the pieces of \*(PP as a tool kit is
  67. thereby provided.
  68.