Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Why does using two indexes slow down my query?
The reason for the slowdown is probably:
a) Counting on condition (1) uses access to the index only. total physical reads = a few leaf blocks for 9,000 rows b) Counting on condition (2) uses access to the index only total physical reads = a few dozen leaf blocks for 80,000 rows c) Counting on both conditions requires access to table rows 9,000 rows to read, on a poor sample space is 1 row in ca. 550 which might be about 1 block in 8 say. If your db_file_multiblock_read_count is set to 32 Oracle will choose between: using 1 read for every 8th block or using 1 read to scan 32 blocks (and getting 4 relevant blocks) A tablescan is 'clearly' the better option. The two pieces of advice you have been given in other posts are both valid. The two-column index is more likely to work for this specific query, but getting better stats is generically a better approach.Received on Tue Jun 09 1998 - 15:43:38 CDT