Skip to content

Instantly share code, notes, and snippets.

View harris-memsql's full-sized avatar

Michael Harris harris-memsql

View GitHub Profile
@harris-memsql
harris-memsql / fractal_demo.sql
Last active October 23, 2017 20:52
Fractal Mandelbrot demo using MemSQL Extensibility
-- First, run this .sql file to load data into the cells table and to create
-- the functions/procedures. Then, you can play around with the demo by
-- SELECTing from the mandelbrot_colors() table valued function. Try
-- running this zsh command for an interesting progression of fractals:
-- zsh -c 'i=3.0; while ((i > 0.0000000001)) && mysql -h 127.0.0.1 -u root -P 3306 --database db <<<"select * from mandelbrot_colors(-0.743643887103515, 0.131825914205310, $i)"; do echo $i; ((i = i /2)); done'
-- You can also pass in a fourth and fifth argument to the mandelobrot_colors function in order to
-- increase the number of pixels.