Skip to content

Instantly share code, notes, and snippets.

@x4m
x4m / g1.sh
Created February 26, 2018 09:05
Intra-page indexing benchmark
#!/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
@x4m
x4m / gist:4b30451dd2882c3266015aa55d3a3173
Created December 10, 2020 06:58
Recrete pg_partitions
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,
@x4m
x4m / Actually stress vxid conversion
Last active July 19, 2021 07:01
stress vxid->xid->2px
package main
import (
"fmt"
"github.com/jackc/pgx"
"math/rand"
"time"
)
var timeToExit = false
@x4m
x4m / Deep RelationBuildDesc
Created August 8, 2021 11:16
Deep RelationBuildDesc
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/