From: Abbas B. <abb...@en...> - 2013-05-24 01:21:27
|
Hi, While working on test case plancache it was brought up as a review comment that solving bug id 3607975 should solve the problem of the test case. However there is some confusion in the statement of bug id 3607975. "When a user does and PREPARE and then EXECUTEs multiple times, the coordinator keeps on preparing and executing the query on datanode al times, as against preparing once and executing multiple times. This is because somehow the remote query is being prepared as an unnamed statement." Consider this test case A. create table abc(a int, b int); B. insert into abc values(11, 22); C. prepare p1 as select * from abc; D. execute p1; E. execute p1; F. execute p1; Here are the confusions 1. The coordinator never prepares on datanode in response to a prepare issued by a user. In fact step C does nothing on the datanodes. Step D simply sends "SELECT a, b FROM abc" to all datanodes. 2. In step D, ExecuteQuery calls BuildCachedPlan to build a new generic plan, and steps E and F use the already built generic plan. For details see function GetCachedPlan. This means that executing a prepared statement again and again does use cached plans and does not prepare again and again every time we issue an execute. My conclusion is that the bug ID 3607975 is not reproducible. Comments are welcome. -- *Abbas* Architect Ph: 92.334.5100153 Skype ID: gabbasb www.enterprisedb.co <http://www.enterprisedb.com/>m<http://www.enterprisedb.com/> * Follow us on Twitter* @EnterpriseDB Visit EnterpriseDB for tutorials, webinars, whitepapers<http://www.enterprisedb.com/resources-community>and more<http://www.enterprisedb.com/resources-community> |