-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #303 from dutow/seqreadtests
Added sequential scan performance tests
- Loading branch information
Showing
7 changed files
with
130 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
cd "$(dirname "$0")" | ||
|
||
xz -d pp-2019.csv.xz | ||
RECORDS=`wc -l pp-2019.csv` | ||
echo "CSV entries: $RECORDS" | ||
cp pp-2019.csv /tmp/ | ||
createdb seq_read_test | ||
psql seq_read_test < seq_read_prepare.sql > /dev/null | ||
echo "Sequential scan read times" | ||
echo "==========================" | ||
echo -n "HEAP: " | ||
HEAP=`psql seq_read_test < seq_read_run_heap.sql | grep "Execution" | tail -n 10 | cut -d " " -f 4 | paste -sd+ | bc` | ||
echo $HEAP | ||
echo -n "TDE: " | ||
TDE=`psql seq_read_test < seq_read_run_tde.sql | grep "Execution" | tail -n 10 | cut -d " " -f 4 | paste -sd+ | bc` | ||
TDE_PERC=`bc <<< "$TDE*100/$HEAP"` | ||
echo "$TDE ($TDE_PERC%)" | ||
echo -n "TDE_BASIC: " | ||
TDE_BASIC=`psql seq_read_test < seq_read_run_tde_basic.sql | grep "Execution" | tail -n 10 | cut -d " " -f 4 | paste -sd+ | bc` | ||
TDE_BASIC_PERC=`bc <<< "$TDE_BASIC*100/$HEAP"` | ||
echo "$TDE ($TDE_BASIC_PERC%)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
CREATE EXTENSION pg_tde; | ||
|
||
SELECT pg_tde_add_key_provider_file('file-store','/tmp/pg_tde_test_keyring.per'); | ||
SELECT pg_tde_set_principal_key('test-db-principal-key','file-store'); | ||
|
||
|
||
CREATE TABLE land_registry_price_paid_uk( | ||
transaction uuid, | ||
price numeric, | ||
transfer_date date, | ||
postcode text, | ||
property_type char(1), | ||
newly_built boolean, | ||
duration char(1), | ||
paon text, | ||
saon text, | ||
street text, | ||
locality text, | ||
city text, | ||
district text, | ||
county text, | ||
ppd_category_type char(1), | ||
record_status char(1)); | ||
|
||
CREATE TABLE land_registry_price_paid_uk_tde( | ||
transaction uuid, | ||
price numeric, | ||
transfer_date date, | ||
postcode text, | ||
property_type char(1), | ||
newly_built boolean, | ||
duration char(1), | ||
paon text, | ||
saon text, | ||
street text, | ||
locality text, | ||
city text, | ||
district text, | ||
county text, | ||
ppd_category_type char(1), | ||
record_status char(1)) USING tde_heap; | ||
|
||
CREATE TABLE land_registry_price_paid_uk_tde_basic( | ||
transaction uuid, | ||
price numeric, | ||
transfer_date date, | ||
postcode text, | ||
property_type char(1), | ||
newly_built boolean, | ||
duration char(1), | ||
paon text, | ||
saon text, | ||
street text, | ||
locality text, | ||
city text, | ||
district text, | ||
county text, | ||
ppd_category_type char(1), | ||
record_status char(1)) USING tde_heap_basic; | ||
|
||
COPY land_registry_price_paid_uk FROM '/tmp/pp-2019.csv' with (format csv, encoding 'win1252', header false, null '', quote '"', force_null (postcode, saon, paon, street, locality, city, district)); | ||
|
||
COPY land_registry_price_paid_uk_tde FROM '/tmp/pp-2019.csv' with (format csv, encoding 'win1252', header false, null '', quote '"', force_null (postcode, saon, paon, street, locality, city, district)); | ||
|
||
COPY land_registry_price_paid_uk_tde_basic FROM '/tmp/pp-2019.csv' with (format csv, encoding 'win1252', header false, null '', quote '"', force_null (postcode, saon, paon, street, locality, city, district)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde_basic; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde_basic; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde_basic; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde_basic; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde_basic; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde_basic; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde_basic; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde_basic; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde_basic; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde_basic; | ||
EXPLAIN ANALYZE SELECT * FROM land_registry_price_paid_uk_tde_basic; |