Skip to content

Instantly share code, notes, and snippets.


Michael Harris harris-memsql

View GitHub Profile
harris-memsql / fractal_demo.sql
Last active Oct 23, 2017
Fractal Mandelbrot demo using MemSQL Extensibility
View fractal_demo.sql
-- 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 -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.