Skip to content

Commit

Permalink
Merge pull request #4854 from EnterpriseDB/docs/edits_to_pg_extension…
Browse files Browse the repository at this point in the history
…s_pr4805

small cleanup to new content
  • Loading branch information
nidhibhammar authored Sep 27, 2023
2 parents 6837c3b + e5503c0 commit e07b977
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions advocacy_docs/pg_extensions/advanced_storage_pack/using.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The following are scenarios where the EDB Advanced Storage Pack TAMs are useful.

## Refdata example

A scenario where Refdata is useful is when creating a reference table of all
A scenario where Refdata is useful is creating a reference table of all
the New York Stock Exchange (NYSE) stock symbols and their corporate names.
This data is expected to change very rarely and be referenced frequently from a
table tracking all stock trades for the entire market.
Expand All @@ -32,7 +32,7 @@ CREATE INDEX ON nyse_trade USING BTREE(nyse_symbol_id);
```

When `heap` is used for `nyse_symbol`, manipulating rows in `nyse_trade` causes
row locks to be created in `nyse_symbol`, but only row locks are used in
row locks to be created in `nyse_symbol`. But only row locks are used in
`nyse_symbol`:

```sql
Expand Down Expand Up @@ -82,7 +82,7 @@ CREATE TABLE nyse_symbol (
) USING refdata;
```

In this case, manipulating data in `nyse_trade` does not generate row locks in `nyse_symbol`. But manipulating `nyse_symbol` directly cause an `EXCLUSIVE` lock to be acquired on the entire relation:
In this case, manipulating data in `nyse_trade` doesn't generate row locks in `nyse_symbol`. But manipulating `nyse_symbol` directly causes an `EXCLUSIVE` lock to be acquired on the entire relation:

```sql
=# BEGIN;
Expand Down Expand Up @@ -143,7 +143,7 @@ SELECT autocluster.autocluster(
```

!!! Note
The `cols` parameter specifies which table is clustered. In this case, `{1}` corresponds to the first column of the table, `thermostat_id`, which is the most common access pattern.
The `cols` parameter specifies the table that's clustered. In this case, `{1}` corresponds to the first column of the table, `thermostat_id`, which is the most common access pattern.
!!!

Populate the table with the `thermostat_id` and `recordtime` data:
Expand Down Expand Up @@ -243,19 +243,19 @@ ANALYZE nyse_trade;
```

Given that the inserts intercalated `nyse_symbol_id`, a query that consults one
stock would touch most pages if the table used `heap`, but would touch far
stock touches most pages if the table uses heap, but touches far
fewer pages using Autocluster.

The following query operates on attributes that must be fetched from the table
after an index scan, and shows the number of buffers touched:
after an index scan and shows the number of buffers touched:

```sql
EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF, COSTS OFF)
SELECT AVG(trade_volume * trade_price)
FROM nyse_trade WHERE nyse_symbol_id = 10;
```

This is the query plan using `autocluster`:
This is the query plan using Autocluster:

```
QUERY PLAN
Expand All @@ -272,7 +272,7 @@ This is the query plan using `autocluster`:
(9 rows)
```

For contrast, this is the query plan using `heap`:
For contrast, this is the query plan using heap:

```
QUERY PLAN
Expand Down

0 comments on commit e07b977

Please sign in to comment.