Skip to content

Instantly share code, notes, and snippets.

@recurse-id
recurse-id / kh.js
Last active November 2, 2022 00:32
kh.js
/**
* Created by urvish on 8/20/14.
*/
/*
Copyright Alex Leone, David Nufer, David Truong, 2011-03-11. kathack.com
javascript:var i,s,ss=['http://kathack.com/js/kh.js','http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js'];for(i=0;i!=ss.length;i++){s=document.createElement('script');s.src=ss[i];document.body.appendChild(s);}void(0);
*/
var BORDER_STYLE = "1px solid #bbb",
@recurse-id
recurse-id / plpythonu tips
Last active August 8, 2020 14:39
Some tips on creating pl/python functions in psql
1) instead of returning SETOF composite_type or SETOF RECORD (OUT col type) return TABLE (col type,etc) and just yield.
2) For long queries in plpy.execute use triple quotes for multiline queries
3) use explain [query] to figure out what is taking so much time on a query then build indexes to remove the "sequential scans"