Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7bae9ff

Browse files
committed
Fixed storage for clob in output bugger table - make it inline.
Changed how delete from output buffer table is handled - use ROWID. Increased fetch size from 100 to 3000 rows for output buffer.
1 parent 76b0d56 commit 7bae9ff

3 files changed

Lines changed: 14 additions & 13 deletions

File tree

source/core/output_buffers/ut_output_buffer_tmp.sql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ begin
3232
is_finished = 0 and (text is not null or item_type is not null )
3333
or is_finished = 1 and text is null and item_type is null ),
3434
constraint ut_output_buffer_fk1 foreign key (output_id) references ut_output_buffer_info_tmp$(output_id)
35-
) organization index overflow nologging initrans 100 ';
35+
) nologging initrans 100
36+
';
3637
begin
3738
execute immediate
38-
v_table_sql || 'lob(text) store as securefile ut_output_text(retention none)';
39+
v_table_sql || 'lob(text) store as securefile ut_output_text(retention none enable storage in row)';
3940
exception
4041
when e_non_assm then
4142
execute immediate
42-
v_table_sql || 'lob(text) store as basicfile ut_output_text(pctversion 0)';
43+
v_table_sql || 'lob(text) store as basicfile ut_output_text(pctversion 0 enable storage in row)';
4344

4445
end;
4546
end;

source/core/output_buffers/ut_output_table_buffer.tpb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ create or replace type body ut_output_table_buffer is
7878
end;
7979

8080
overriding member function get_lines(a_initial_timeout natural := null, a_timeout_sec natural := null) return ut_output_data_rows pipelined is
81+
type t_rowid_tab is table of urowid;
82+
l_message_rowids t_rowid_tab;
8183
l_buffer_data ut_output_data_rows;
82-
l_message_ids ut_integer_list;
8384
l_finished_flags ut_integer_list;
8485
l_already_waited_for number(10,2) := 0;
8586
l_finished boolean := false;
@@ -90,14 +91,14 @@ create or replace type body ut_output_table_buffer is
9091
lc_long_sleep_time constant number(1) := 1; --sleep for 1 s when waiting long
9192
lc_long_wait_time constant number(1) := 1; --waiting more than 1 sec
9293
l_sleep_time number(2,1) := lc_short_sleep_time;
93-
lc_bulk_limit constant integer := 100;
94+
lc_bulk_limit constant integer := 3000;
9495

95-
procedure remove_read_data(a_message_ids ut_integer_list) is
96+
procedure remove_read_data(a_message_rowids t_rowid_tab) is
9697
pragma autonomous_transaction;
9798
begin
98-
delete from ut_output_buffer_tmp a
99-
where a.output_id = self.output_id
100-
and a.message_id in (select column_value from table(a_message_ids));
99+
forall i in 1 .. a_message_rowids.count
100+
delete from ut_output_buffer_tmp a
101+
where rowid = a_message_rowids(i);
101102
commit;
102103
end;
103104

@@ -112,13 +113,13 @@ create or replace type body ut_output_table_buffer is
112113
begin
113114
while not l_finished loop
114115
with ordered_buffer as (
115-
select a.message_id, ut_output_data_row(a.text, a.item_type), is_finished
116+
select a.rowid, ut_output_data_row(a.text, a.item_type), is_finished
116117
from ut_output_buffer_tmp a
117118
where a.output_id = self.output_id
118119
order by a.message_id
119120
)
120121
select b.*
121-
bulk collect into l_message_ids, l_buffer_data, l_finished_flags
122+
bulk collect into l_message_rowids, l_buffer_data, l_finished_flags
122123
from ordered_buffer b
123124
where rownum <= lc_bulk_limit;
124125

@@ -147,7 +148,7 @@ create or replace type body ut_output_table_buffer is
147148
exit;
148149
end if;
149150
end loop;
150-
remove_read_data(l_message_ids);
151+
remove_read_data(l_message_rowids);
151152
end if;
152153
if l_finished or l_already_waited_for >= l_wait_for then
153154
remove_buffer_info();

source/install.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ prompt Installing DBMSPLSQL Tables objects into &&ut3_owner schema
194194
@@install_component.sql 'expectations/data_values/ut_cursor_column.tps'
195195
@@install_component.sql 'expectations/data_values/ut_cursor_column_tab.tps'
196196
@@install_component.sql 'expectations/data_values/ut_cursor_details.tps'
197-
@@install_component.sql 'expectations/data_values/ut_data_value_anydata.tps'
198197
@@install_component.sql 'expectations/data_values/ut_data_value_blob.tps'
199198
@@install_component.sql 'expectations/data_values/ut_data_value_boolean.tps'
200199
@@install_component.sql 'expectations/data_values/ut_data_value_clob.tps'

0 commit comments

Comments
 (0)