.
3.40m are done!
To carry out the partitioning, the table must reorganized once again (just "partitioned"). That would the giant tables with hundreds of millions of entries that we have in the eye, a seemingly feasible task, if it was not possible to carry out this work online, so while the table is used productively. This is indeed possible, and the statement defines a new command for the backup and restore tool
BRSPACE
by which this redefinition can be done online.
For us, unfortunately, still too early for the note - be the required Support Package level, we have in the relevant systems probably only come in the Andean year - but we are looking forward to it! The reference leads the tables
MSEG
,
BDCP
,
CDHDR
& co.
LIPS
,
VBRP
so on. This shows that the authors know their Pappenheimer. These tables are included in our retail systems to the greatest.
Since we did not want to wait until the information is available on our systems, we have the tables of the Retail Information Systems
(RIS) independently made the start, especially our largest info-structure, the table
S520. It has 420 million entries. The primary key consists essentially of the week, the item number and the branch using the table two years are kept in the past should. The mere filing of the (unpartitioned), the periodic table, and compression of the data by product cost the system a week around 103,000 seconds, or about 28 hours. Here one should remember that the S520 only
a table of the RIS (albeit the largest) - there's still more of their ilk ...
needed After partitioning the "archive" [2] with the new program
Z_RIS_PARTITION_REORG
DELETE statements hadprotected section.
namely blocks are read into the database buffer to evaluate the where condition. This does not apply to the DROP PARTITION statement
: The buffer is available for other statements. Also, the merchandise category compression program could nevertheless still be accelerated by a factor of 200, since it operates only on the current calendar week and so only one partition must search.
course it was a stroke of luck to start with the
S520
: it has in our system at the database level, no inter-partition secondary indexes: All existing secondary indexes contain the substance used for the partitioning week (
SPWOC
) so that the removal of partition no Index update is necessary. There are other information structures for which we use inter-partition indices. Then it will not take two seconds, but two minutes to delete a partition. But this is still orders of magnitude faster than the current archiving and deletion times. How did
We organized the partitioning programs? The centerpiece is the SAP class
CL_SQL_STATEMENT
. To delete partitions or create, we need the method
execute_ddl (
statement
)
use this class. We have for this purpose, a local abstract superclass
lcl_stmnt
introduced that contains an object of type
CL_SQL_STATEMENT
as delegate. From the upper class for each statement type your own classes are derived, which have the task of substituting in "their" Statement of the current parameters of the call and then the specific statement as a string by calling a method to execute the upper class:
class lcl_stmt definition abstract.
public section.
methods:
constructor importing iv_tablename type tabname.
gv_tabname type tabname,public section.
go_sql_stmt type ref to cl_sql_statement.
endclass.
class lcl_split_partition_stmt definition inheriting from lcl_stmt.
gv_where = go_ref-> get_where_for_adrc (gs_sel).
The module test class for the method
get_where_adrc ()
should therefore not make a string comparison, as this would be too inflexible. Actually, only to be ensured in every test case that
all selections in the specified Result occur
does not occur is not specified selections in the result,
the component names are mapped to the right column names in the database table,
that the values in the expected manner to a
LIKE
pattern or in a comparison value for
EQ
be mapped
that the individual terms are syntactically lined up correctly with
AND
.
not to be tested, however, occur in what order the individual conditions in the Where clause. Even though space is to act as a separator between each word - but it should not matter what or how much Space stands.
order on failure to have a nice overview, added to which combinations does not work, I use 32 test methods whose name is a concatenation of feature names have been given for the selections:
hausnr_ort_plz method.
gs_sel-house number = '15 '.
gs_sel-location = 'Beuson-Nendaz'.
gs_sel-zip = '1996 '.
course I have not written down these 32 methods of hand. After looking at the implementation an exemplary test method had become clear, I wrote a Perl program I generated the code of these methods to insert in the ABAP-test class. Here it is: my%
values = (zip => '1996 'place,
=>' Beuson-Nendaz '
country =>' CH ', street
=>' Rue Gaspard ', House No.
=>' 15 ');
my @ names = sort keys% values;
my ($ fieldset, $ generate, $ pos, @ fields);
for $ generate (\\ & generate_method_definition,
\\ & generate_method_implementation fieldset) {
$ = 0;
for (1 .31) {
vec ($ fieldset, 0.8) = $ _;
$ pos = 0;
$ Assignments check_where_clause_for ('% s'). get_expected_fields (
exporting iv_fields = iv_fields
importing et_expected_fields = lt_expected_fields).
Thurs
lv_last_conjunction = lv_conjunction.
clear: lv_subject, lv_predicate, lv_object, lv_conjunction.
if sy-subrc ne 0lv_s condense.
* Statement is completed
lv_s = gv_where + lv_off.
\u0026lt;ls_field_exp> name-* field was found, delete from table of the expected fields
into gv_msg respecting blanks.
assert_equal (act = lv_object
exp =-exp \u0026lt;ls_field_exp>
msg = gv_msg).
* Unexpected field
'unexpected box
lv_subject
concatenate' is selected that does not appear in the selections'
into gv_msg respecting blanks.
fail (gv_msg).
endif.
endif.
ENDDO.
assert_initial (act = lv_last_conjunction msg = 'must come after last term is no longer AND').
assert_initial (act = lt_expected_fields
msg = 'in the SELECT statement is missing fields,' & 'were specified in the selection').
ENDMETHOD. "Check_where_clause_for
core of this mini-parser for Where conditions is a regular expression to basic selection criteria as
mc_city1 like '% Beuson NENDAZ%%' and
fit. He cut such a term in a subject, predicate, object and the optional conjunction
and linking this to the next term if necessary. For the passed list
iv_fields
the selection fields used an internal table
lt_expected_fields
is built with the test expectations. This is like a scratch list after every found term reduced and must be empty at the end (otherwise the statement was larger than expected).
be just Thus, the above expectations tested to check but without white space and order. For example, if this is a new field in the selection of running all existing Tests without errors. One can write down further tests for the new field or generate - only then you have to expand at a point, the table of expectations for the new field.
Of course the tests in more than five degrees of freedom is too unwieldy, we will have to be restricted to a meaningful subset. The mini-parser but still remains useful.