Querying Data
This topic provides information about using SQL in HAWQ databases.
You enter SQL statements called queries to view and analyze data in a database using the psql interactive SQL client and other client tools.
Note: HAWQ queries timeout after a period of 600 seconds. For this reason, long-running queries may appear to hang until results are processed or until the timeout period expires.
-
This topic provides an overview of how HAWQ processes queries. Understanding this process can be useful when writing and tuning queries.
-
In HAWQ, you can use GPORCA or the legacy query optimizer.
-
HAWQ is based on the PostgreSQL implementation of the SQL standard. SQL commands are typically entered using the standard PostgreSQL interactive terminal
psql, but other programs that have similar functionality can be used as well. -
HAWQ evaluates functions and operators used in SQL expressions.
-
HAWQ dynamically allocates resources to queries. Query performance depends on several factors such as data locality, number of virtual segments used for the query and general cluster health.
-
Examine the query plans of poorly performing queries to identify possible performance tuning opportunities.