View previous topic :: View next topic |
Author |
Message |
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Thu May 20, 2021 9:02 am Post subject: Defining an index where you know the values of key fields |
|
|
I am wondering if DB2 has the following capability.
I have a table that has approximately 170 million rows. I have a scenario where I want to delete the rows from this table where column_1 has a value of "AA" and column_2 has a resolved_date of null (i.e. has not been resolved).
If there was an index created on these two columns, there would need to be space allocated for 170 million indexes. I was wondering if there is a capability in DB2 where a rule could be defined that when a row has a column with a value of "AA" and a resolved date of null that the row_ID is captured or something to that effect.
If there is no other need for this index other than for this exact condition, it seems like a waste of space to create an index to hold all the other combinations of column-1,column_2 when I am only interested in the condition I mention above.
Is this possible? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Thu May 20, 2021 12:24 pm Post subject: |
|
|
Thank you Kolusu. |
|
Back to top |
|
|
haatvedt Beginner
Joined: 14 Nov 2003 Posts: 66 Topics: 0 Location: St Cloud, Minnesota USA
|
Posted: Tue May 25, 2021 10:14 pm Post subject: |
|
|
If you are only using this new index to delete rows from the table, you might consider the following which would be more efficient.
Set up an on demand REORG job which includes a DISCARD parameter. It's more efficient and you get the reorganization done at the same time. _________________ Chuck Haatvedt
email --> clastnameatcharterdotnet
(replace lastname, at, dot with appropriate
characters) |
|
Back to top |
|
|
|
|