This file contains hidden or 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
\set QUIET on | |
\pset linestyle unicode | |
\pset null ¤ | |
;\set PROMPT1 '%n@%/=%#%x ' | |
\pset pager on | |
\x auto | |
\set HISTCONTROL ignoreboth | |
\set HISTSIZE 10000 | |
\set HISTFILE ~/.psql_history- :DBNAME | |
\set PSQL_EDITOR 'vim -c ":set ft=sql"' |
This file contains hidden or 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
/* ON PROD DB */ | |
CREATE TEMP TABLE exported_stats AS | |
select | |
schemaname, | |
tablename, | |
attname, | |
null_frac, | |
avg_width, | |
n_distinct, |
This file contains hidden or 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
-- | |
-- PostgreSQL database dump | |
-- | |
-- Dumped from database version 17.4 (Ubuntu 17.4-1.pgdg24.04+2) | |
-- Dumped by pg_dump version 17.4 (Ubuntu 17.4-1.pgdg24.04+2) | |
SET statement_timeout = 0; | |
SET lock_timeout = 0; | |
SET idle_in_transaction_session_timeout = 0; |
This file contains hidden or 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
region | country | year | production | consumption | |
---|---|---|---|---|---|
North America | USA | 1965 | 9014 | 11522 | |
North America | USA | 1966 | 9579 | 12100 | |
North America | USA | 1967 | 10219 | 12567 | |
North America | USA | 1968 | 10600 | 13405 | |
North America | USA | 1969 | 10828 | 14153 | |
North America | USA | 1970 | 11297 | 14710 | |
North America | USA | 1971 | 11156 | 15223 | |
North America | USA | 1972 | 11185 | 16381 | |
North America | USA | 1973 | 10946 | 17318 |
This file contains hidden or 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
--- DROP TABLE IF EXISTS customer, product, payment_method, "order", order_item CASCADE ; | |
CREATE TABLE customer ( | |
customer_id BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, | |
name TEXT NOT NULL, | |
dob DATE NOT NULL, | |
email TEXT UNIQUE NOT NULL, | |
created_on TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP | |
); |
This file contains hidden or 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
100 | Steven | King | SKING | 515.123.4567 | 2003-06-17 | AD_PRES | 24000.00 | 90 | |||
---|---|---|---|---|---|---|---|---|---|---|---|
101 | Neena | Kochhar | NKOCHHAR | 515.123.4568 | 2005-09-21 | AD_VP | 17000.00 | 100 | 90 | ||
102 | Lex | De Haan | LDEHAAN | 515.123.4569 | 2001-01-13 | AD_VP | 17000.00 | 100 | 90 | ||
103 | Alexander | Hunold | AHUNOLD | 590.423.4567 | 2006-01-03 | IT_PROG | 9000.00 | 102 | 60 | ||
104 | Bruce | Ernst | BERNST | 590.423.4568 | 2007-05-21 | IT_PROG | 6000.00 | 103 | 60 | ||
105 | David | Austin | DAUSTIN | 590.423.4569 | 2005-06-25 | IT_PROG | 4800.00 | 103 | 60 | ||
106 | Valli | Pataballa | VPATABAL | 590.423.4560 | 2006-02-05 | IT_PROG | 4800.00 | 103 | 60 | ||
107 | Diana | Lorentz | DLORENTZ | 590.423.5567 | 2007-02-07 | IT_PROG | 4200.00 | 103 | 60 | ||
108 | Nancy | Greenberg | NGREENBE | 515.124.4569 | 2002-08-17 | FI_MGR | 12008.00 | 101 | 100 | ||
109 | Daniel | Faviet | DFAVIET | 515.124.4169 | 2002-08-16 | FI_ACCOUNT | 9000.00 | 108 | 100 |
This file contains hidden or 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
CREATE TABLE IF NOT EXISTS public.employees_simple | |
( | |
employee_id numeric(6,0) NOT NULL, | |
first_name character varying(20), | |
last_name character varying(25) NOT NULL, | |
email character varying(25) NOT NULL, | |
phone_numeric character varying(20), | |
hire_date date NOT NULL, | |
job_id character varying(10), | |
salary numeric(8,2), |
This file contains hidden or 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
#!/bin/bash | |
if [ -z "$4" ]; then | |
echo "Usage: ./launch_vms_and_run_test.sh INSTANCE_ID REGION STORAGE_TYPE STORAGE_MIN" | |
echo "Example:" | |
echo " ./launch_vms_and_run_test.sh run1-ebs eu-south-2 network 100" | |
exit 1 | |
fi | |
mkdir logs results |
This file contains hidden or 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
#!/bin/bash | |
set -exuo pipefail | |
export PGPORT=5432 | |
export PGDATABASE=postgres | |
export PGHOST=/var/run/postgresql | |
export PGUSER=postgres | |
ROWS=2e8 |
This file contains hidden or 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
-- | |
-- PostgreSQL database dump | |
-- | |
-- Dumped from database version 15.5 (Ubuntu 15.5-1.pgdg22.04+1) | |
-- Dumped by pg_dump version 15.5 (Ubuntu 15.5-1.pgdg22.04+1) | |
SET statement_timeout = 0; | |
SET lock_timeout = 0; | |
SET idle_in_transaction_session_timeout = 0; |
NewerOlder