start new:
tmux
start new with session name:
tmux new -s myname
create temp table t1(t1_id serial primary key, reference varchar(16) not null unique, value varchar(16) not null); | |
copy t1(reference, value) from stdin; | |
FOO foo | |
BAR bar | |
QUUX quux | |
\. | |
create temp view t1_combined as | |
select t1_id, reference, value, ctid, lp_flags, lp_off, case when t_ctid <> ctid then t_ctid end as t_ctid, | |
t_xmin, xmin_visible, case when t_xmax::text <> '0' then t_xmax end as t_xmax, xmax_visible, |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
So I just found ZFS on my test Linux ubuntu system, and gave my perf-tools (https://github.com/brendangregg/perf-tools) a spin.
Per-second zfs* calls:
# ./funccount -Ti 1 'zfs*'
Tracing "zfs*"... Ctrl-C to end.
Tue Aug 5 00:51:41 UTC 2014
FUNC COUNT
# install openjdk | |
sudo apt-get install openjdk-7-jdk | |
# download android sdk | |
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz | |
tar -xvf android-sdk_r24.2-linux.tgz | |
cd android-sdk-linux/tools | |
# install all sdk packages |
TL;DR
Install Postgres 9.5, and then:
sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Draw psql output as iTerm2 v3 inline graph using matplotlib | |
# Author: Alexander Korotkov <a.korotkov@postgrespro.ru> | |
import sys | |
import re | |
import warnings | |
import matplotlib | |
matplotlib.use("Agg") |
-- Installs "file_fdw" extension and creates foreign table to work with data from CSV file. | |
-- See also the comment below which helps to automate the process for Google Spreadsheets | |
-- Another option would be using Multicorn for Google Spreadsheets, but it requires additional steps | |
-- (see https://wiki.postgresql.org/wiki/Foreign_data_wrappers). | |
create extension file_fdw; | |
create server "import" foreign data wrapper file_fdw; | |
create foreign table "table1" ( | |
col1 text, |
TL;DR
Install Postgres 9.6, and then:
sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main