| --- |
| title: Querying Data |
| --- |
| |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| |
| 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. |
| |
| - **[About HAWQ Query Processing](../query/HAWQQueryProcessing.html)** |
| |
| This topic provides an overview of how HAWQ processes queries. Understanding this process can be useful when writing and tuning queries. |
| |
| - **[About GPORCA](../query/gporca/query-gporca-optimizer.html)** |
| |
| In HAWQ, you can use GPORCA or the legacy query optimizer. |
| |
| - **[Defining Queries](../query/defining-queries.html)** |
| |
| 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. |
| |
| - **[Using Functions and Operators](../query/functions-operators.html)** |
| |
| HAWQ evaluates functions and operators used in SQL expressions. |
| |
| - **[Query Performance](../query/query-performance.html)** |
| |
| 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. |
| |
| - **[Query Profiling](../query/query-profiling.html)** |
| |
| Examine the query plans of poorly performing queries to identify possible performance tuning opportunities. |
| |
| |
| |
| |