[Rt-devel] Question about Type column in table Tickets

Andrew Sullivan ajs at crankycanuck.ca
Fri Jul 1 10:49:11 EDT 2005


On Fri, Jun 24, 2005 at 02:12:56PM +0200, Rolf Grossmann wrote:
> that. IMHO it's a serious flaw in Oracle's query optimizer that adding a 
> condition that's always true significantly slows down a query.

Well, it still has to visit every row.  There's no way to know in
advance that the condition is _always_ true, because the optimiser is
cost-based (and therefore can only use statistics for this).  It's
possible that the planning step would take a different strategy
(using an index, say); but it'd still have to visit every row, and
using an index in that case would be even more expensive.

The simple problem is that the condition isn't a selective one, and this
suggests to me that the query is a bad one, given the structure.  (My
experience overall with RT is that the automatic generation of SQL
causes all sorts of poorly-written queries like this, that generate
needless conditions that slow everything down).

A

-- 
Andrew Sullivan  | ajs at crankycanuck.ca
The fact that technology doesn't work is no bar to success in the marketplace.
		--Philip Greenspun


More information about the Rt-devel mailing list