| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |

09-03-09, 05:54
|
|
Registered User
|
|
Join Date: Sep 2003
Posts: 36
|
|
|
index on one columntable
|
|
a table XYZ with single column of datatype char (3) is involved with join with another table that has a indexed predicate. the table XYX has no index defined on it, and the explain statemen resulted in tablespace scan and would like to know if it is advisable to create unique index on the one column table so that Index space scan is taken. pls advice.
Rgds
Roger
|
|

09-03-09, 06:12
|
|
Registered User
|
|
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
|
|
It may be beneficial because index entries are sorted and, thus, DB2 can narrow down the search scope - which it can't do in a table scan, typically. However, if the table only contains a few rows, then it won't give you much benefit (if any).
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
|
|

09-03-09, 08:20
|
|
Registered User
|
|
Join Date: Sep 2003
Posts: 36
|
|
|
|
yes I agree with you, but the table contains just 1 row only and I am just to avoid the ridpool failue by makng a indexable predicate but htis contains just 1 row only. Is there any way one can aoid ridpool getting failed ?
|
|

09-03-09, 09:34
|
|
Registered User
|
|
Join Date: Dec 2008
Posts: 76
|
|
Do it for concurrency. Index locks don't usually cause timeouts or deadlocks, row and table locks do.
__________________
RD
|
Last edited by rdutton; 09-03-09 at 09:44.
|

09-03-09, 09:34
|
|
Registered User
|
|
Join Date: Nov 2005
Location: IL
Posts: 554
|
|
I haven't tried it myself, but according to what I saw Scott Haas reported you might get a benefit.
Why not create an index and see what happens. It should take less time then to respond to this
Please do let us know what you have found 
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
DB2 v9.1.0.2 os 5.3.0.0
|
|

09-03-09, 11:58
|
|
Registered User
|
|
Join Date: May 2009
Posts: 472
|
|
sahana, maybe it is just me but what are you using a 1 column, 1 row table for? Have you considered using SYSIBM.SYSDUMMY1 instead if you just need a table to query with (such as when doing Date arithmetic)?
|
|

09-03-09, 14:40
|
|
∞∞∞∞∞∞
|
|
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
|
|
Quote:
|
Originally Posted by Cougar8000
...according to what I saw Scott Haas reported you might get a benefit.
|
Alex, May I ask who Scott Haas is?
|
|

09-03-09, 15:07
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 3,575
|
|
Quote:
|
Originally Posted by db2girl
Alex, May I ask who Scott Haas is?
|
I think he means Scott Hayes of DBI.
Andy
|
|

09-03-09, 15:26
|
|
Registered User
|
|
Join Date: Nov 2005
Location: IL
Posts: 554
|
|
|
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
DB2 v9.1.0.2 os 5.3.0.0
|
|

09-03-09, 17:04
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,196
|
|
Maybe I am missing something, but I don't see how DB2 would choose to use an index on a table with one row (unless you altered the cardinality to volatile, or plugged your own numbers in the stats).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

09-04-09, 11:15
|
|
Registered User
|
|
Join Date: Dec 2008
Posts: 76
|
|
It probably wouldn't - the initial post just said it was a one column table, not a one column/one row table.
Although I have seen LUW use an index with cardinality so low that zOS definitely wouldn't.
__________________
RD
|
|

09-04-09, 14:27
|
|
Registered User
|
|
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
|
|
Roger,
What exactly are you after here? Trying to speed up a query? Just research? If it is for a particular query, let us see the SQL, we may be able to offer up some more helpful advice, as was mentioned using sysdummy1 and other items as well.
Dave
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|