Friday 15 July 2011

paraccel - postgresql cursor is slow on update -


As a brief introduction, I am new to postgresql Also, postgresql version requires advice on I 8.1 . The reason for this is the postgresql 8.1 Paracel's final implementation and supported version of this language.

At least 8.1, in Postgrascape cursor with DML operation, such as the update or INSERT (Haven) test, has been removed, even if it is the same. This is just an example to display:

  create table tab_cur_DML_test (col_key int, col_dml varchar (50));   

Populate it with some records from some table:

  insert tab_cur_DML_test (col_key, col_dml) from card_id, card_dim card_dim;   

tab_cur_DML_test now has some thousand records with two fields

  fn_cursor_DML_test () returns a zero as the function to create or change because $ Body $ declare v_col_key card_dim.card_id% type; V_col_dml card_dim.card_no% type; Q Refresh; V_count_proccessed_recs Great thing: = 0; Start the Open Core for card card selection, card_dim to card_no; Loop v_col_key, v_col_dml; If not found then exit; end if; Update tab_cur_DML_test set col_dml = v_col_dml where col_key = v_col_key; V_count_proccessed_recs: = v_count_proccessed_recs + 1; If v_count_proccessed_recs% 10 = 0 then the information '%', v_count_proccessed_recs; end if; End loop; End; $ Body $ language plpgsql unstable;   

After running it:

  select * fn_cursor_DML_test ();   

The speed comes out to be about one thousand records of 30 seconds.

Again, this is just a simple update that can be done as a set-based operation. I used it here to simulate line-per-line processing with the cursor in the same real work situation when line-by-line processing is required, in situations when plain SQL is used Otherwise, otherwise, it will be very heavy and / or complex, the use of the cursor does not make a viable option with such low processing speed.

I suspect that this is due to the context switch in the database engine. My question is whether in Paragale (V. 4.0) - if there are any possible solutions (or certain methods) to make important improvements in line-by-line arguments within the postgreSQL 8.1 cursor?

Thank you!

Stanislav

Paraxel is not PostgreSQL. These are two separate products with different features designed for different purposes, based on ParAccel PostgreSQL, but it uses column storage, MPP and adapter were completely rewritten. It just happened that they kept the PL extension (in some cases the possibility of reducing the ETC's archestress), but they dropped support. Other competitors like Vertica - their products also do not have PGPL expansion.

The symptoms you are experiencing are nothing to do with PostgreSQL. This is the exact reason that paraxal does not support PGPL / SQL Parser. Databases were not prepared for line-by-line processing, because its columnar single update / insertion / removal resources will take a lot of resources because you will do the same operation on millions of lines. Why do you need to use PL here? Just run an update ... and read more about the column database. If you need to run the line-by-line operation and you do not like it very much, then paracels are not the right product for your needs.




No comments:

Post a Comment