Home > database >  Learn about DB2 database optimization of several strategies
Learn about DB2 database optimization of several strategies

Time:10-04

1, used for subsequent table index (note before inserting data to establish or set up but after insert to you)

Description: insert before set up, the process of inserting data in the table, the index also with the update, so need larger log space, so speed will slowly, can be used without inserting log way; Data sent after the index, then the table of log statistics information is not updated, so the plan will be very poor, with less than the index, you on tabble asiainfo. Aaaa and indexes after all, index statistics will be updated, such execution plan would consider to use the index, so fast,

More than 2, will be built on the table node table space, at the same time build index

Description: existing db2 data warehouse each node USES two CPU, 4 gb of memory, DIM table space plan is a table of space dimension table, so is the single node, when using the table in the table space, at most, only can use 2 CPU, 4 gb of memory, plus other table Spaces are used both CPU and the 4 gb of memory, so the resources are limited, suggest a larger table don't put in the table space, but to create a good partitioning key, on multi-node table space, so when to retrieve the list of 32 nodes retrieved at the same time, the final summary node 0 on the show, will, of course, very fast, in addition, although the 32 nodes parallelism is good, but if established indexes, faster!!!!!

3, insert insert table use to log into

Description: database in order to guarantee the consistency of the data and can be rolled back, insert, update, or delete data when you need to log, so at the time of failure can be rolled back, but if too many concurrent or very big, can lead to compete for the log, operation is very slow, if you use to log in a way that insert, update, or delete operation, use little log, but there is no back if the operation fails, such consistency not guaranteed, this table can only remove rebuild!!!!!!!!!!

4, will build table level lock table, to reduce the number of lock to use

Note: the database lock is one of the biggest quantity is limited, and each lock accounts for a certain amount of memory, so if the number of locks are very much, use memory is much, lead to resources nervous,

5, build the temporary table to insert the data, data is not plugged in less than

Note: a lot of places in the program in order to improve the speed, will use the data inserted into a temporary table in the first, but by inserting data is not used very much, so lead to a temporary table is very big also, so as far as possible, only to a temporary table to insert the data, and as far as possible using the index, can greatly improve the speed,

6, a little about the link left

Using tips: as far as possible in the inside of the on the condition of only write associated conditions and to the left of the associated table limits, and restrictions on the main table don't write here, if write in it, not only is very slow, and may appear puzzling result,


Turn to http://develop.csai.cn/dbms/200701051442391179.htm

CodePudding user response:

Support for sharing ~ ~

CodePudding user response:

Good,

CodePudding user response:

up

CodePudding user response:

Sex sex pick up points

CodePudding user response:

learning

CodePudding user response:

Just this! Can do it?

CodePudding user response:

The up

CodePudding user response:

To encourage the

CodePudding user response:

The breeze

CodePudding user response:

Are all very good advice! Worth learning

CodePudding user response:

Pay attention to pick up points

CodePudding user response:

This simple ah, online search will get the answer.

CodePudding user response:

There is a problem, don't understand.
Built an empty table, built the index, and then insert into the table 11000 data,
Then you on table * * *. * * * * and indexes all;
Results the execution plan is bad, became a full table scan, or index scan before you
Does anyone know why?
  • Related