Database Reference
In-Depth Information
tions of the same data. In this case, the inefficiency of looping is trivial compared to
the continued cost of repeated queries to the same data.
PERFORM versus SELECT
You may have noticed a statement in the previous example that we haven't covered
yet. PERFORM is the command to use when you want to just discard the results of a
statement. If the previous example were changed to:
SELECT cs_log("Done refreshing materialized
views");
The query engine would return No destination for result data .
We could retrieve the results into variables and then proceed to ignore the variables,
but that is just a little too sloppy for my taste. By using the PERFORM statement, we
have indicated that ignoring the results was not accidental. We were happy with the
fact that the log was appended to blindly, and if it wasn't, oh well, we didn't fail to
continue the execution because of a log entry issue.
Search WWH ::




Custom Search