- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Why doesnB4t it use the index??
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2003 12:55 AM
тАО09-26-2003 12:55 AM
Re: Why doesnB4t it use the index??
INDEX_NAME
------------------------------
COLUMN_NAME
SUAPOS_UIND
BASMAN_NL
SUAPOS_UIND
BASMAN_NR
SUAPOS_UIND
SUAKPF_BEZNR
SUAPOS_UIND
SUAPOS_POSNR
SUAPOS_1
BASMAN_NL
SUAPOS_1
BASMAN_NR
SUAPOS_1
SUAKPF_BEZNR
SUAPOS_1
SUAPOS_POSNR
SUAPOS_2
BASMAN_NL
SUAPOS_2
BASMAN_NR
SUAPOS_2
SUAKPF_BEZNR
SUAPOS_2
SUAPOS_STATUS
SUAPOS_3
BASMAN_NL
SUAPOS_3
BASMAN_NR
SUAPOS_3
SUAKPF_BEZNR
SUAPOS_3
SUAPOS_AWBZZZ
16 Zeilen ausgew├Г┬дhlt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2003 08:57 AM
тАО09-26-2003 08:57 AM
Re: Why doesnB4t it use the index??
A small variation on Brian's request would make the output more readable, more useable:
column COLUMN_NAME format a20;
column INDEX_NAME format a15;
select INDEX_NAME, COLUMN_POSITION "Pos", COLUMN_NAME from ALL_IND_COLUMNS
where TABLE_NAME = 'SUAPOS' order by INDEX_NAME, COLUMN_POSITION
/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2003 06:20 AM
тАО10-05-2003 06:20 AM
Re: Why doesnB4t it use the index??
I will be gone again til Oct. 20th
INDEX_NAME Pos COLUMN_NAME
--------------- ---------- --------------------
SUAPOS_UIND 1 BASMAN_NR
SUAPOS_UIND 2 BASMAN_NL
SUAPOS_UIND 3 SUAKPF_BEZNR
SUAPOS_UIND 4 SUAPOS_POSNR
SUAPOS_1 1 SUAPOS_POSNR
SUAPOS_1 2 BASMAN_NR
SUAPOS_1 3 BASMAN_NL
SUAPOS_1 4 SUAKPF_BEZNR
SUAPOS_2 1 SUAPOS_STATUS
SUAPOS_2 2 BASMAN_NR
SUAPOS_2 3 BASMAN_NL
SUAPOS_2 4 SUAKPF_BEZNR
SUAPOS_3 1 SUAPOS_AWBZZZ
SUAPOS_3 2 BASMAN_NR
SUAPOS_3 3 BASMAN_NL
SUAPOS_3 4 SUAKPF_BEZNR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2003 06:28 AM
тАО10-05-2003 06:28 AM
Re: Why doesnB4t it use the index??
Off slightly track here, but there are some VEY good reasons why the SQL engine may not pik the an indexed route.
1 - variations in index is too small, e.g. male/female.
2 - Estimate for number of rows retrieved is quite large > 25% of table
3 - Table is very small. An index scan could be SLOWEER!
4 - Statistics out of date (this is really an error)
Regards
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2003 09:27 PM
тАО10-05-2003 09:27 PM
Re: Why doesnB4t it use the index??
SELECT /*+ INDEX (SUPAS SUAPOS_UIND) */ ROWID, suapos.*
FROM suapos
WHERE basman_nr = :ph0
AND basman_nl = :ph1
ORDER BY basman_nr, basman_nl, suakpf_beznr, suapos_posnr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-06-2003 06:49 AM
тАО10-06-2003 06:49 AM
Re: Why doesnB4t it use the index??
select count(*) from suapos;
select count(*) from suapos where basman_nr = 'whatever' and basman_nl = 'whatever';
Compare the two counts. If the count from the second query is a large percentage of the first count, a FTS is justified.
If not, try reanalyzing the indexes:
analyze table suapos estimate statistics sample 30 percent;
analyze table suapos compute statistics for all indexes;
analyze table suapos compute statistics for all indexed columns;
The combination of those three analyzes will give you detailed statistics on the indexes down to the column level (including data distribution inside each column).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-06-2003 03:33 PM
тАО10-06-2003 03:33 PM
Re: Why doesnB4t it use the index??
Its very hard to tell without the output of explain plan, but from what you have posted, it looks like you have the defaults set for optimizer_index_cost_adj=100 and optimizer_index_caching=0 parameters which makes oracle to think single block read and multi block read both costs the same. This is not true most of the cases especially in OLTP systems. Besides, you have db_file_multi_block_read_count (dbfmrc) set to 32 which makes full table scan lot cheaper than single block index read.
Query returning < 15% of rows from a dataset means it has to use index -- this is absolutely in-correct. Its all depends on how the data in placed in the block.
for e.g, if each of basman_nr and basman_nl row found in all available table blocks say 20, then which one oracle would prefer? definitely it would go for full table scan as its easy to read all 20 blocks in one dbfmrc with cost of 1 as opposed to indexes where the cost is 21 (20 single data block read + 1 leaf block read)
Anyway, 10053 trace should give you an idea of why full table scan was cheaper than index.
hth,
Stan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2003 04:03 AM
тАО10-20-2003 04:03 AM
Re: Why doesnB4t it use the index??
I did, what you proposed and I found out, that basman_nr has only 6 different values and basman_nl only 28. SQL Analyze says, it expects 478 lines from 76650 rows, which is significant less than 1%. Cost for first rows would use Index. Cost for all rows however not. Rule based would use Index. If I delete statistics for this table and indices only, would it use rule and would this be advisable?
Michael
- « Previous
-
- 1
- 2
- Next »