Skip to content

Instantly share code, notes, and snippets.

View rmloveland's full-sized avatar

Rich Loveland rmloveland

View GitHub Profile
3 admin-ui-cluster-overview-page.md
3 admin-ui-statements-page.md
3 cockroachdb-architecture.md
4 admin-ui-overview.md
5 import-data.md
5 install-cockroachdb-spatial.md
6 performance-benchmarking-with-tpc-c-10-warehouses.md
6 performance-benchmarking-with-tpc-c-100k-warehouses.md
6 performance-benchmarking-with-tpc-c-10k-warehouses.md
6 performance-benchmarking-with-tpc-c-1k-warehouses.md
@rmloveland
rmloveland / bookstores-initial-import-20200911.sql
Created December 8, 2020 19:42
Data set created by downloading a list of bookstores from American Bookseller Association. Geometries added by getting lon/lat using geocoding based on some Tiger/LINE data.
This file has been truncated, but you can view the full file.
CREATE TABLE IF NOT EXISTS public.bookstores (
id UUID NOT NULL DEFAULT gen_random_uuid(),
name STRING NOT NULL,
url STRING NULL,
phone STRING NULL,
address STRING NOT NULL,
description STRING NULL,
geom GEOMETRY NULL,
CONSTRAINT "primary" PRIMARY KEY (id ASC),
INVERTED INDEX bookstore_geom_idx (geom),
#!perl
use strict;
use warnings;
use experimentals;
use constant DEBUG => undef;
die usage() unless scalar @ARGV >= 2;
(module-extends javafx.application.Application)
(import (srfi 1)
(class javafx.application Application)
(class javafx.scene Group Scene)
(class javafx.stage Stage)
(class javafx.scene.canvas Canvas)
(class javafx.scene.canvas GraphicsContext)
(class javafx.scene.paint Color))
(define (hilbert order width)
(let loop ((count 0)
(shape (h0 width)))
(if (= count order)
shape
(let* ((next-shape (shrink-shape shape 0.5))
(upper-left (reflect-shape (rotate-shape next-shape (* 3.14159 1.5))))
(upper-right (translate-shape next-shape 'east width))
(lower-left (translate-shape next-shape 'south width))
(lower-left* (reflect-shape (rotate-shape lower-left (* 3.14159 .5))))
(module-extends javafx.application.Application)
(import (class javafx.application Application)
(class javafx.scene Group Scene)
(class javafx.stage Stage)
(class javafx.animation FillTransition)
(class javafx.animation Timeline)
(class javafx.animation ParallelTransition)
(class javafx.animation RotateTransition)
(class javafx.animation ScaleTransition)
Version: CockroachDB CCL v19.2.2 (x86_64-apple-darwin14, built 2019/12/11 01:27:47, go1.12.12)
CREATE TABLE salaries (
emp_no INT4 NOT NULL,
salary INT4 NOT NULL,
from_date DATE NOT NULL,
to_date DATE NOT NULL,
CONSTRAINT "primary" PRIMARY KEY (emp_no ASC, from_date ASC),
CONSTRAINT salaries_ibfk_1 FOREIGN KEY (emp_no) REFERENCES employees(emp_no) ON DELETE CASCADE,
Version: CockroachDB CCL v19.2.2 (x86_64-apple-darwin14, built 2019/12/11 01:27:47, go1.12.12)
CREATE TABLE current_salaries (
emp_no INT4 NULL,
salary INT4 NULL,
from_date DATE NULL,
to_date DATE NULL,
INDEX current_salaries_salary_idx (salary ASC),
INDEX current_salaries_emp_no_idx (emp_no ASC),
Version: CockroachDB CCL v19.2.2 (x86_64-apple-darwin14, built 2019/12/11 01:27:47, go1.12.12)
CREATE TABLE employees (
emp_no INT4 NOT NULL,
birth_date DATE NOT NULL,
first_name VARCHAR(14) NOT NULL,
last_name VARCHAR(16) NOT NULL,
gender STRING NOT NULL,
hire_date DATE NOT NULL,
Version: CockroachDB CCL v19.2.2 (x86_64-apple-darwin14, built 2019/12/11 01:27:47, go1.12.12)
CREATE TABLE salaries (
emp_no INT8 NOT NULL,
salary INT8 NOT NULL,
from_date DATE NOT NULL,
to_date DATE NOT NULL,
CONSTRAINT "primary" PRIMARY KEY (emp_no ASC, from_date ASC),
CONSTRAINT salaries_ibfk_1 FOREIGN KEY (emp_no) REFERENCES employees(emp_no) ON DELETE CASCADE,