WARNING

This text was automatically converted from troff me macros to HTML. Information may have been lost, added, or changed in the process. Lars Aronsson and Lysator do not guarantee the correctness of this HTML document.

"SECTION 6 *- FAST PATH"

NAME

fast path *- trap door into system internals

SYNOPSIS

retrieve (retval = function([ arg { , arg } ] )

DESCRIPTION

POSTGRES allows any valid POSTGRES function to be called in this way. Prior implementations of fast path allowed user functions to be called directly. For now, the above syntax should be used, with arguments cast into the appropriate types. By executing the above type of query, control transfers completely to the user function; any user function can access any POSTGRES function or any global variable in the POSTGRES address space.

There are six levels at which calls can be performed:

1) Traffic cop level If a function wants to execute a POSTGRES command and pass a string representation, this level is appropriate.

2) Parser A function can access the POSTGRES parser, passing a string and getting a parse tree in return.

3) Query optimizer A function can call the query optimizer, passing it a parse tree and obtaining a query plan in return.

4) Executor A function can call the executor and pass it a query plan to be executed.

5) Access methods A function can directly call the access methods if it wishes.

6) Function manager A function can call other functions using this level.

Documentation of layers 1-6 will appear at some future time. Meanwhile, fast path users must consult the source code for function names and arguments at each level.

It should be noted that users who are concerned with ultimate performance can bypass the query language completely and directly call functions that in turn interact with the access methods. On the other hand, a user can implement a new query language by coding a function with an internal parser that then calls the POSTGRES optimizer and executor. Complete flexibility to use the pieces of POSTGRES as a tool kit is thereby provided.