@
leeoo@
profiledef aaa():
for i in range(10000):
sqlcmd='''select * from link_tbl where link_id=10360000000013'''
cur.execute(sqlcmd)
b=cur.fetchall()
aaa()
@
profiledef bbb():
sqlcmd='''
CREATE OR REPLACE FUNCTION bbb()
RETURNS smallint
LANGUAGE plpgsql volatile
AS $$
DECLARE
node_id bigint;
i integer;
BEGIN
for i in 1..10000 loop
select s_node into node_id from link_tbl where link_id=10360000000013;
end loop;
return 1;
END;
$$;
select bbb();
'''
cur.execute(sqlcmd)
conn_str.commit()
bbb()
@
profiledef ccc():
for i in range(10000):
sqlcmd='''select 10360000000013;'''
cur.execute(sqlcmd)
b=cur.fetchall()
ccc()