Skip to content

Instantly share code, notes, and snippets.

@sdebnath
sdebnath / mxact_create.sql
Last active January 20, 2022 05:41
Test workload for PostgreSQL MultiXact: create new mxacts
CREATE OR REPLACE FUNCTION mxact_create(SCALE integer) RETURNS void AS $body$
declare
default_rows_per_scale integer := 100000;
gap integer := 3000;
range integer := 100;
create_base_id integer;
segment_id integer;
begin
-- Generate a random number to use as a segment to offset concurrent connections from hitting the same exact range of ids
select (trunc(extract(millisecond from current_timestamp) * default_rows_per_scale, 0) % (100000 * scale)) into create_base_id;
begin;
select mxact_create(:scale);
-- select mxact_create_and_select(:scale);
commit;
@sdebnath
sdebnath / keybindings.json
Last active December 4, 2023 19:57
VSCode Key Bindings
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+q",
"command": "editor.action.peekDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
},
{
"key": "alt+f12",
"command": "-editor.action.peekDefinition",