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
Last login: Sun Aug 8 13:57:34 on ttys000 | |
/usr/local/opt/[email protected]/bin/python3.9: Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: No module named 'virtualenvwrapper') | |
virtualenvwrapper.sh: There was a problem running the initialization hooks. | |
If Python could not import the module virtualenvwrapper.hook_loader, | |
check that virtualenvwrapper has been installed for | |
VIRTUALENVWRAPPER_PYTHON=/usr/local/opt/python/libexec/bin/python and that PATH is | |
set properly. | |
/Users/x4mmm/mdb-scripts/completion.zsh.inc:32: command not found: compdef | |
x4mmm@x4mmm-2osx postgresA % cd contrib/amcheck/ |
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
package main | |
import ( | |
"fmt" | |
"github.com/jackc/pgx" | |
"math/rand" | |
"time" | |
) | |
var timeToExit = false |
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
SET allow_system_table_mods = true; | |
ALTER VIEW pg_catalog.pg_partitions RENAME TO pg_partitions_lock; | |
create view pg_catalog.pg_partitions as | |
select | |
schemaname, | |
tablename, | |
partitionschemaname, | |
partitiontablename, |
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
#!/usr/bin/env bash | |
set -e | |
declare -a blksz=("2048" "4096" "8192" "16384" "32768") | |
declare -a trshs=("8" "16" "24" "32") | |
## now loop through the above array | |
for size in "${blksz[@]}" | |
do |
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
\timing | |
create table r as | |
select int4range(g, g+10) ir, g g | |
from generate_series(1,1000000) g | |
order by random(); | |
create index r_idx on r using gist (ir); |
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
\timing | |
create extension if not exists pg_background; | |
create table input as select round(random()*20) x from generate_series(1,5,1); | |
create table output(place int,value int); | |
create sequence s start 1; | |
create table handles as select pg_background_launch('select pg_sleep('||x||'); insert into output values (nextval(''s''),'||x||');') h from input; |
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
float pack_float_bits(const float v, const int r) | |
{ | |
union { | |
float f; | |
struct { unsigned value:31, sign:1; } vbits; | |
struct { unsigned value:29, realm:2, sign:1; } rbits; | |
} a; | |
a.f = v; | |
a.rbits.value = a.vbits.value >> 2; |
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
\timing | |
SET client_min_messages = 'DEBUG5'; | |
SET log_min_messages = 'DEBUG5'; | |
SET wal_level = 'minimal'; | |
create extension if not exists cube; | |
begin transaction; | |
SELECT setseed(.43); |
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
\timing | |
SET client_min_messages = 'DEBUG5'; | |
SET log_min_messages = 'DEBUG5'; | |
SET wal_level = 'minimal'; | |
create extension if not exists cube; | |
begin transaction; | |
SELECT setseed(.43); |
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
\timing | |
SET client_min_messages = 'DEBUG5'; | |
SET log_min_messages = 'DEBUG5'; | |
SET wal_level = 'minimal'; | |
create extension if not exists cube; | |
begin transaction; | |
SELECT setseed(.43); |
NewerOlder