hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dyozie <...@git.apache.org>
Subject [GitHub] incubator-hawq-docs pull request #101: HAWQ-1383 - plpgsql page cleanup, res...
Date Fri, 10 Mar 2017 17:45:38 GMT
Github user dyozie commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq-docs/pull/101#discussion_r105436546
  
    --- Diff: markdown/plext/using_plpgsql.html.md.erb ---
    @@ -19,143 +19,278 @@ software distributed under the License is distributed on an
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
    --->
    +--> 
     
    -SQL is the language of most other relational databases use as query language. It is portable
and easy to learn. But every SQL statement must be executed individually by the database server.

    +PL/pgSQL is a trusted procedural language that is automatically installed and registered
in all HAWQ databases. With PL/pgSQL, you can:
     
    -PL/pgSQL is a loadable procedural language. PL/SQL can do the following:
    +-   Create functions
    +-   Add control structures to the SQL language
    +-   Perform complex computations
    +-   Use all of the data types, functions, and operators defined in SQL
     
    --   create functions
    --   add control structures to the SQL language
    --   perform complex computations
    --   inherit all user-defined types, functions, and operators
    --   be trusted by the server
    +SQL is the language most relational databases use as a query language. While it is portable
and easy to learn, every SQL statement is individually executed by the database server. Your
client application sends each query to the database server, waits for it to be processed,
receives and processes the results, does some computation, then sends further queries to the
server. This back-and-forth requires interprocess communication and incurs network overhead
if your client is on a different host than the HAWQ master.
     
    -You can use functions created with PL/pgSQL with any database that supports built-in
functions. For example, it is possible to create complex conditional computation functions
and later use them to define operators or use them in index expressions.
    +PL/pgSQL does not have these limitations. When creating functions with the PL/pgSQL language,
you can group computation blocks and queries inside the database server, combining the power
of a procedural language and the ease of use of SQL, but with considerable savings of client/server
communication overhead. With PL/pgSQL:
    --- End diff --
    
    I see what you mean here, but am concerned about the blanket statement "Pl/pgsql does
not have these limitations."  You're comparing db-executed functions with a client/server
architecture, but the above statement is contrasting with a very general statement about SQL
itself.  I don't think pgsql gets you around any inherent limitations of SQL as you've stated
them.
    
    I guess my concern comes from the recent limitations added regarding cursor support in
PL languages.  It's natural to assume you can open a cursor and move through a query directly
in the language, but really the cursor operations (and other SQL) are still exec'd on the
db.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message