Lots of "BIND" and "PARSE" appear in csvlog
In my PostgreSQL csvlog files, I find lots of "BIND" and "PARSE" Key word in the csv log files,just as the following:
Is there any one can explain the meaning of "BIND" and "PARSE" which appear in the csv log?
I dont konw if it's normal ,or ther is a problem,thanks!
PostgreSQL VERSION: 9.0.1
--"BIND" csvlog
2011-07-29 09:50:01.154 CST,"netpk","netpk",674,"192.168.170.37:41022",4e3211b2.2a2,2,"BIND",2011-07-29 09:49:38 CST,212/1074044,0,LOG,00000,"duration: 3539.601 ms bind : select * from t_tmp where skyid=$1 and appid=$2 ","parameters: $1 = '202882651', $2 = '324016开发者_运维百科'",,,,,,,,""
--"PARSE" csvlog
2011-07-29 09:50:01.177 CST,"netpk","netpk",727,"192.168.170.37:41098",4e3211b7.2d7,3,"PARSE",2011-07-29 09:49:43 CST,269/687465,0,LOG,00000,"duration: 1420.256 ms parse <unnamed>: select * from (select * from t_tmp where appid=$1 and status=0 and manual_status=0 )t where 1=1 and C9=3 and (C0>0 and C0<10) order by C0 desc,skyid desc offset $2 limit $3 ",,,,,,,,,""
Those are prepared statements; an application is submitting statements without actual parameters, so that the PostgreSQL server can parse the statement, and prepare it server side.
As you can see from your log, the query can get a number of positional parameters; those are given by the subsequent execute statements.
The advantage is that the query parsing and planning is done only once, rather than each time the query is submitted.
精彩评论