Skip to content

Commit c11bd2a

Browse files
Merge pull request #262393 from v-akarnase/patch-33
Update apache-hbase-phoenix-performance.md
2 parents e0ef658 + 79fc802 commit c11bd2a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

articles/hdinsight/hbase/apache-hbase-phoenix-performance.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Best practices to optimize Apache Phoenix performance for Azure HDI
44
ms.service: hdinsight
55
ms.topic: how-to
66
ms.custom: hdinsightactive
7-
ms.date: 12/26/2022
7+
ms.date: 01/04/2024
88
---
99

1010
# Apache Phoenix performance best practices
@@ -42,7 +42,7 @@ With this new primary key the row keys generated by Phoenix would be:
4242
| Dole-John-111|1111 San Gabriel Dr.|1-425-000-0002| John|Dole| 111 |
4343
| Raji-Calvin-222|5415 San Gabriel Dr.|1-230-555-0191| Calvin|Raji| 222 |
4444

45-
In the first row above, the data for the rowkey is represented as shown:
45+
In the first row of given table, the data for the rowkey is represented as shown:
4646

4747
|rowkey| key| value|
4848
|------|--------------------|---|
@@ -107,7 +107,7 @@ Secondary indexes can improve read performance by turning what would be a full t
107107

108108
Covered indexes are indexes that include data from the row in addition to the values that are indexed. After finding the desired index entry, there's no need to access the primary table.
109109

110-
For example, in the example contact table you could create a secondary index on just the socialSecurityNum column. This secondary index would speed up queries that filter by socialSecurityNum values, but retrieving other field values will require another read against the main table.
110+
For example, in the example contact table you could create a secondary index on just the socialSecurityNum column. This secondary index would speed up queries that filter by socialSecurityNum values, but retrieving other field values require another read against the main table.
111111

112112
|rowkey| address| phone| firstName| lastName| socialSecurityNum |
113113
|------|--------------------|--------------|-------------|--------------| ---|
@@ -145,7 +145,7 @@ The main considerations in query design are:
145145

146146
### Understand the query plan
147147

148-
In [SQLLine](http://sqlline.sourceforge.net/), use EXPLAIN followed by your SQL query to view the plan of operations that Phoenix will perform. Check that the plan:
148+
In [SQLLine](http://sqlline.sourceforge.net/), use EXPLAIN followed by your SQL query to view the plan of operations that Phoenix performs. Check that the plan:
149149

150150
* Uses your primary key when appropriate.
151151
* Uses appropriate secondary indexes, rather than the data table.
@@ -155,13 +155,13 @@ In [SQLLine](http://sqlline.sourceforge.net/), use EXPLAIN followed by your SQL
155155

156156
As an example, say you have a table called FLIGHTS that stores flight delay information.
157157

158-
To select all the flights with an airlineid of `19805`, where airlineid is a field that isn't in the primary key or in any index:
158+
To select all the flights with an `airlineid` of `19805`, where `airlineid` is a field that isn't in the primary key or in any index:
159159

160160
```sql
161161
select * from "FLIGHTS" where airlineid = '19805';
162162
```
163163

164-
Run the explain command as follows:
164+
Run the explained command as follows:
165165

166166
```sql
167167
explain select * from "FLIGHTS" where airlineid = '19805';
@@ -196,13 +196,13 @@ CLIENT 1-CHUNK PARALLEL 1-WAY ROUND ROBIN RANGE SCAN OVER FLIGHTS [2014,1,2,'AA'
196196

197197
The values in square brackets are the range of values for the primary keys. In this case, the range values are fixed with year 2014, month 1, and dayofmonth 2, but allow values for flightnum starting with 2 and on up (`*`). This query plan confirms that the primary key is being used as expected.
198198

199-
Next, create an index on the FLIGHTS table named `carrier2_idx` that is on the carrier field only. This index also includes flightdate, tailnum, origin, and flightnum as covered columns whose data is also stored in the index.
199+
Next, create an index on the FLIGHTS table named `carrier2_idx` that is on the carrier field only. This index also includes `flightdate`, `tailnum`, `origin`, and `flightnum` as covered columns whose data is also stored in the index.
200200

201201
```sql
202202
CREATE INDEX carrier2_idx ON FLIGHTS (carrier) INCLUDE(FLIGHTDATE,TAILNUM,ORIGIN,FLIGHTNUM);
203203
```
204204

205-
Say you want to get the carrier along with the flightdate and tailnum, as in the following query:
205+
Say you want to get the carrier along with the `flightdate` and `tailnum`, as in the following query:
206206

207207
```sql
208208
explain select carrier,flightdate,tailnum from "FLIGHTS" where carrier = 'AA';

0 commit comments

Comments
 (0)