Re: Cost Based Optimizer
Posted in 1993
In <1993Sep27.130957.8224@pyra.co.uk> graeme@pyra.co.uk (Graeme Sargent) writes:
>This is to be expected. OnLine uses a Selectivity Factor of
>1/sysindexes.nunique for an indexed_col = <literal> filter and a
>Selectivity Factor of 0.2 for a matches expression.
I'd be happy to be allowed to write,
select * from foo where bar matches "blurfl*" selectivity 1/100000 ...
Or even being able to tell it the estimated #rows directly (or better yet,allow either).
How 'bout it, Informix? I'd love to tell your optimizer what I know...
Imagine, doing "or" wouldn't necessarily do a sequential scan all the time!
select * from foo where (key = 1000 selectivity 1/100000 or
key in
(select groupkey from groups where key = 1000
selectivity 1/10e7)
) and date > 1/1/1990 selectivity 0.2
(Which is, BTW, nearly like some code in our system that must be done
with a union else it does a sequential scan on millions of records.)
I would gladly give up sql portability for this...
--
Andrew Burt aburt@du.edu
"But if he was dying he wouldn't bother to carve "Aaaaargh", he'd just say it."