Skip to content

Instantly share code, notes, and snippets.

CREATE TABLE table0 (
col0 DATE NULL, col1 INT2 NULL, col2 NAME NOT NULL, col3 REGTYPE, col4 OID NULL, col5 REGPROC, col6 UUID NOT NULL, col7 BIT(15), col8 TIME,
FAMILY fam0 (col3),
FAMILY fam1 (col6, col1, col7),
FAMILY fam2 (col5),
FAMILY fam3 (col0),
FAMILY fam4 (col8, col2),
FAMILY fam5 (col4),
PRIMARY KEY (col3 ASC),
UNIQUE (col2),
explain select g.game, g.blizzid, g.winner from (select game, blizzid from players where build=68 and mode=1 and hero_level >= 5) p join players g on p.game = g.game and p.blizzid = g.blizzid where g.skill > 25000000;
set experimental_force_lookup_join = true;
@maddyblue
maddyblue / sql
Last active December 4, 2017 19:41
2015,All Races,Both Sexes,,733.1
2014,All Races,Both Sexes,78.9,724.6
2013,All Races,Both Sexes,78.8,731.9
2012,All Races,Both Sexes,78.8,732.8
2011,All Races,Both Sexes,78.7,741.3
2010,All Races,Both Sexes,78.7,747.0
2009,All Races,Both Sexes,78.5,749.6
2008,All Races,Both Sexes,78.2,774.9
2007,All Races,Both Sexes,78.1,775.3
2006,All Races,Both Sexes,77.8,791.8
This file has been truncated, but you can view the full file.
10 Seconds=10 Seconds
Abil/Activity/AbathurUltimateEvolution=Ultimate Evolution
Abil/Activity/AerialBlitzkrieg=Aerial Blitzkrieg
Abil/Activity/ArthasSummonSindragosa=Summon Sindragosa
Abil/Activity/CaptureMacGuffin=Capturing
Abil/Activity/CaptureMacGuffinParent=Capturing
Abil/Activity/CollectingOffering=Collecting Offering
Abil/Activity/DeepTunnelActivity=Deep Tunnel
Abil/Activity/DiabloLightningBreath=Lightning Breath
Abil/Activity/DryadNoxiousBlossom=Pollinating
@maddyblue
maddyblue / gist:7187003ad87dc5a4417c929cca203dcd
Last active September 20, 2017 21:06
load csv progress notes
For local:
First phase is all of total progress. Initial, simple, implementation is to count the number of files (N), each file, after being converted to KVs, counts for 1/N of this phase's progress. Follow up work to get the file size from the export storage. Then progress for this phase is number of bytes processed / total number of bytes (among all files).
For distributed:
Sampling phase is 1/3 of total progress. Same deal as local with counting files and then file sizes for progress, also keeping track of number of KVs produced.
Second phase is 1/3 of total progress. As KVs are consumed and written to RocksDB, progress is total number of written KVs / total number of KVs (among all distsql processors).
package test
import (
"bytes"
"database/sql"
"flag"
"fmt"
"math"
"math/rand"
"runtime"
@maddyblue
maddyblue / postgres_test.go
Created January 10, 2017 06:32
apd test with 2 arguments
// Copyright 2016 The Cockroach Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@maddyblue
maddyblue / main.go
Created December 15, 2016 21:51
postgres v crdb float checker
package main
import (
"database/sql"
"fmt"
"log"
"math"
"math/rand"
"github.com/cockroachdb/cockroach/pkg/util/randutil"

Keybase proof

I hereby claim:

  • I am mjibson on github.
  • I am mjibson (https://keybase.io/mjibson) on keybase.
  • I have a public key whose fingerprint is DDDA B438 B8AD E806 F1D5 68B7 BDB2 D1BB 9135 19AE

To claim this, I am signing this object:

==> kube-apiserver.log <==
I0930 02:45:00.550361 15299 handlers.go:131] POST /api/v1/namespaces/default/events: (7.383885ms) 201 [[kubelet/v1.1.0 (linux/amd64) kubernetes/b67028f] 127.0.0.1:36566]
I0930 02:45:00.556931 15299 handlers.go:131] GET /api/v1/namespaces/default/pods/nginx: (1.333617ms) 200 [[kubelet/v1.1.0 (linux/amd64) kubernetes/b67028f] 127.0.0.1:36566]
I0930 02:45:00.560711 15299 handlers.go:131] PUT /api/v1/namespaces/default/pods/nginx/status: (2.51882ms) 200 [[kubelet/v1.1.0 (linux/amd64) kubernetes/b67028f] 127.0.0.1:36566]
==> kube-controller-manager.log <==
I0930 02:45:00.561793 15325 controller.go:153] No jobs found for pod nginx, job controller will avoid syncing
I0930 02:45:00.561813 15325 controller.go:250] Pod nginx updated.
I0930 02:45:00.561863 15325 controller.go:214] No daemon sets found for pod nginx, daemon set controller will avoid syncing