111 reputation
1
bio website
location
age
visits member for 2 years, 8 months
seen 14 hours ago

Apr
13
awarded  Student
Apr
12
comment Oracle faster overlap check
@Phil I've thought of one more solution, oracle will count the index only when count() is done on a NOT NULL column with an index. If beginRange and endRange are NOT NULL and both have an index, we can have three sums: [ count(endRange) where inputBegin > endRange ] + [ count(beginRange) where inputEnd < beginRange ] = [ count(beginRange/endRange) ] Above is true if there is no overlap. so with UNION ALL I would get three rows, and in the code I need to check if sum of first two equals the third. Of course I'm assuming only index will be counted and no rows will be accessed. Any other way?
Apr
12
comment Oracle faster overlap check
@Phil I didn't get you
Apr
12
comment Oracle faster overlap check
@Phil but when we're doing a count(*) wouldn't it be enough to count the index entries itself? Is it always like this?
Apr
12
comment Oracle faster overlap check
@Phil in your example, what is causing a 'TABLE ACCESS BY INDEX ROWID', why will oracle not count the index only?
Apr
12
asked Oracle faster overlap check