473,382 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Which tablespce is used when running ALTER TABLE & CREATE INDEX

Could someone confirm which tablespace is being used when running ALTER &
CREATE INDEX.
Is it the tempspace or the tablespace where the table resides?

Many thanks,
maricel
Nov 12 '05 #1
4 5849
maricel <ma*****@xtra.co.nz> wrote:
Could someone confirm which tablespace is being used when running ALTER &
CREATE INDEX.
Is it the tempspace or the tablespace where the table resides?


What do you mean with "which tablespace is being used"? An ALTER TABLE does
not cause the table's data to be moved around. And an index is created in
the tablespace that was explicitly or implicitly specified in the CREATE
TABLE statement for the table on which the index is to be created. Have a
look at the catalog view SYSCAT.TABLES, column INDEX_TBSPACE. It tells you
the tablespace that will be used for the index.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #2
....and if creation of the index forces a sort that spills to disk, a
SYSTEM temp tablespace will be used.

Knut Stolze wrote:
maricel <ma*****@xtra.co.nz> wrote:

Could someone confirm which tablespace is being used when running ALTER &
CREATE INDEX.
Is it the tempspace or the tablespace where the table resides?

What do you mean with "which tablespace is being used"? An ALTER TABLE does
not cause the table's data to be moved around. And an index is created in
the tablespace that was explicitly or implicitly specified in the CREATE
TABLE statement for the table on which the index is to be created. Have a
look at the catalog view SYSCAT.TABLES, column INDEX_TBSPACE. It tells you
the tablespace that will be used for the index.


Nov 12 '05 #3
Is this means that DB2 will not use some sort of temporary table when
processing the alter statement. In Informix, when altering the table, it
requires at least similar amount of extra space (table size) in the same
table space where the table resides - if my table size is 500MB then I
should have at least 500MB extra space to process the alter statement,
otherwise you can't alter it. In the case of CREATE index, Informix uses the
temporary tablespace to build the index before putting them into their
assigned tablespace.

In DB2, what is the requirement for the ALTER TABLE & CREATE INDEX
processing, does it need extra space & if yes, how large & where?

maricel

"Knut Stolze" <st****@de.ibm.com> wrote in message
news:bv**********@fsuj29.rz.uni-jena.de...
maricel <ma*****@xtra.co.nz> wrote:
Could someone confirm which tablespace is being used when running ALTER & CREATE INDEX.
Is it the tempspace or the tablespace where the table resides?
What do you mean with "which tablespace is being used"? An ALTER TABLE

does not cause the table's data to be moved around. And an index is created in
the tablespace that was explicitly or implicitly specified in the CREATE
TABLE statement for the table on which the index is to be created. Have a
look at the catalog view SYSCAT.TABLES, column INDEX_TBSPACE. It tells you the tablespace that will be used for the index.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena

Nov 12 '05 #4
The alter table statments supported today are all online, and immediate
update. No change to the table's row data is required (and no temporary
space is consumed).

maricel wrote:
Is this means that DB2 will not use some sort of temporary table when
processing the alter statement. In Informix, when altering the table, it
requires at least similar amount of extra space (table size) in the same
table space where the table resides - if my table size is 500MB then I
should have at least 500MB extra space to process the alter statement,
otherwise you can't alter it. In the case of CREATE index, Informix uses the
temporary tablespace to build the index before putting them into their
assigned tablespace.

In DB2, what is the requirement for the ALTER TABLE & CREATE INDEX
processing, does it need extra space & if yes, how large & where?

maricel

"Knut Stolze" <st****@de.ibm.com> wrote in message
news:bv**********@fsuj29.rz.uni-jena.de...
maricel <ma*****@xtra.co.nz> wrote:

Could someone confirm which tablespace is being used when running ALTER
&
CREATE INDEX.
Is it the tempspace or the tablespace where the table resides?


What do you mean with "which tablespace is being used"? An ALTER TABLE


does
not cause the table's data to be moved around. And an index is created in
the tablespace that was explicitly or implicitly specified in the CREATE
TABLE statement for the table on which the index is to be created. Have a
look at the catalog view SYSCAT.TABLES, column INDEX_TBSPACE. It tells


you
the tablespace that will be used for the index.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena


Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rajesh Kumar Mallah | last post by:
Hi , Looks like ADD UNIQUE( some_fuc( some_feild) ) is not supported with add constraint. the only way is to add the constriant is using UNIQUE INDEX . Is it a bug or intended behaviour? ...
4
by: Fan Ruo Xin | last post by:
Hi, I have been watching MDC for a long time ... I have seen it from INDEX-SCAN to INDEX ONLY for the DISTINCT (block index columns) operator .... But the Elapsed time shows MDC still run slower....
10
by: hilz | last post by:
Hi all. I have a table that i create in MsAccess, using ado connection as follows: create table PAYITEM ( PAYITEM_ID COUNTER PRIMARY KEY, PAYITEM_NAME ...
17
by: clintonG | last post by:
I'm using an .aspx tool I found at but as nice as the interface is I think I need to consider using others. Some can generate C# I understand. Your preferences please... <%= Clinton Gallagher ...
2
by: RamaKrishna Narla | last post by:
In MS SQL Server, I have the following tables with some data in it. create table table1 ( column1 varchar(32), column2 int not null, column10 varchar(255), ..... primary key (column1,...
10
by: Laurence | last post by:
Hi there, How to differentiate between unique constraint and unique index? These are very similar but I cannot differentiate them? Could someone give me a hand? Thanks in advance
8
by: rcamarda | last post by:
I thought I would delve into index fragmentation and I found some great sql from many posters (thanks Erland!). My question is how bad is bad? I know this is very subjective. Some scripts I found...
0
by: pjhitchman | last post by:
Hi, Using DB2 version 9, fixpak 2 on AIX 5L. I created my DDL for defining a Primary Key to be done by a ALTER TABLE command, but I could not find a way of naming the tablespace to control were...
1
by: Andy | last post by:
a new user of oracle 10g. tried the following statements on scott/tiger with tablespace x create table mytest ( a varchar2(30) ); alter table mytest add constraint pk_a primary key(a);
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.