php - Is it necessary to use a procedure or function for sequential query with persistent connection -
php - Is it necessary to use a procedure or function for sequential query with persistent connection -
i using postgresql , php within codeigniter framework application.
are there sequential query require order of 1 insert, 1 update , 1 select?
is necessary utilize procedure or function when having persistent connection database sequential database queries?
persistent connection keeping 'pool' faster use, automatic management of connection usage , other associated features, not overlook fact saves overhead time of otherwise making connection each time db query needing execution. select should not need function or procedure unless a. depending on preceding dml operations not want 'dirty read' i.e. want insert / update operations go success , fire select. b. when transforming result of select heavily e.g. selecting 3-4 tables, massaging info in-memory , applying business rules etc. before returning final outcome. yes, advisable encapsulate i/u/d (dml operations) function or procedure when want db processing logic contained in db itself. i.e. don't want ui contain complex db queries , arrive @ performance issues due non-binding variables in queries etc.. also, in example, if have got right , want step 1-3 insert/update , fire select. if bundled operation, either utilize block mode operation or better/easier encapsulate in function/procedure known outcome each time irrespective of success or failure of criteria controlling in proc/function code.
php database postgresql codeigniter
Comments
Post a Comment