How about three, where two are just overloaded, or rather syntactic sugar, for 
the main declaration:

unlikely(expr)
likely(expr)
likelihood(expr, rate)

Where unlikely(expr) -> likelihood(expr, 0.05)
      likely(expr)   -> likelihood(expr, 0.95)

I would presume that the rate is the expected selection rate of expr over the 
entire table, so the correctly computed value of the rate for a table A of a 
given expr, for example:

select * from A where col LIKE '%bach%'

would be

select * from A where likelihood(col like '%bach%', (select count(*) from a 
where col like '%bach%')/(select count(*) from a))
and is not related to the application of other conditionals not included in the 
expr itself.

So, if there are usable statistics available, should the likelihood given be 
ignored; or, should likelihood completely override the statistical input to the 
optimizer?  I vote that the hint should only be used if no other statistical 
data is available.

> Plus an overload: unlikely(expr) ==> likelihood (expr, 0.05)
> 
> (sent from a mobile device - please excuse brevity, typos, and top-
> posting)
> ----- stephan beal
> http://wanderinghorse.net
> On Sep 10, 2013 11:49 PM, "Tim Streater" <t...@clothears.org.uk> wrote:
> 
> > On 10 Sep 2013 at 20:26, Richard Hipp <d...@sqlite.org> wrote:
> >
> > > SURVEY QUESTION:
> > >
> > > The question for today is what to call this magic hint function:
> > >
> > > (1)  unlikely(EXPR)
> > > (2)  selective(EXPR)
> > > (3)  seldom(EXPR)
> > > (4)  seldom_true(EXPR)
> > > (5)  usually_not_true(EXPR)
> > >
> > > Please feel free to suggest other names if you think of any.
> >
> > likelihood (EXPR, value)
> >
> >
> >
> >
> > --
> > Cheers  --  Tim
> >
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> >
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to