SELECT
uid,
kv['c1'] AS c1,
kv['c2'] AS c2,
kv['c3'] AS c3
FROM (
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- query with stored plan | |
CREATE or replace FUNCTION pybench1(id int) RETURNS text AS ' | |
if (SD.has_key("plan")): | |
plan = SD["plan"] | |
else: | |
plan = plpy.prepare("SELECT * FROM pagetimer pt, pagebrowser pb WHERE pt.idtimer = $1 and pt.idtimer = pb.idtimer", ["int4"]) | |
SD["plan"] = plan | |
rec = plpy.execute(plan, [id]) | |
if (rec.nrows() > 0): |