Nathan Kurz wrote:
> I'm using a computationally expensive user defined function called
> 'match()'. In case it makes a difference, match() is written in C,
> and for testing, I'm loading it as a shared library into the sqlite3
> shell application. I want to return the value of match(), and also
Jay Sprenkle wrote:
>
> On 11/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > Original Message
> > > Subject: Re: [sqlite] optimizing out function calls
> > > From: Jay Sprenkle <[EMAIL PROTECTED]>
> > > Date:
On 11/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Original Message
> > Subject: Re: [sqlite] optimizing out function calls
> > From: Jay Sprenkle <[EMAIL PROTECTED]>
> > Date: Mon, November 14, 2005 4:34 pm
> > To: sqli
> Original Message
> Subject: Re: [sqlite] optimizing out function calls
> From: Jay Sprenkle <[EMAIL PROTECTED]>
> Date: Mon, November 14, 2005 4:34 pm
> To: sqlite-users@sqlite.org
>
> > - the random function in C has no arguments, it will produ
> - the random function in C has no arguments, it will produce
> a different result on every call (within the limits of the
> random number generator that is used). Of course from a
> mathematical point of view this is a monstrosity ;).
> Functions should return the same values given the sa
On 11/13/05, Joe Wilson <[EMAIL PROTECTED]> wrote:
> MS Access appears to assume all functions called with the same
> arguments are constant and returns the same result for every row:
>
> SQLite is apparently the other extreme - it assumes that each call a
> function can potentially yield a diffe
Have a look at archive here
http://thread.gmane.org/gmane.comp.db.sqlite.general/13781
At the time I was using the random number generator function and was
confused about its usage.
It may help some of you.
Regards
Nick
Thi
Joe Wilson wrote:
>
> What do other databases return for the types of SQL queries below?
>
> SELECT random(1) AS func FROM test ORDER BY func;
> SELECT random() AS func FROM test WHERE func > 10;
>
> MS Access appears to assume all functions called with the same
> arguments are constant and
What do other databases return for the types of SQL queries below?
SELECT random(1) AS func FROM test ORDER BY func;
SELECT random() AS func FROM test WHERE func > 10;
MS Access appears to assume all functions called with the same
arguments are constant and returns the same result for every
[EMAIL PROTECTED] wrote:
Nathan Kurz <[EMAIL PROTECTED]> wrote:
SELECT uid, match("complex", "function", vector) AS match FROM vectors
ORDER BY match DESC LIMIT 20;
SELECT uid, mx FROM
(SELECT uid, match(...) AS mx FROM vectors LIMIT -1)
ORDER BY mx DESC LIMIT 20;
The LIMIT -1 on the
On 11/13/05, Nathan Kurz <[EMAIL PROTECTED]> wrote:
>
> On Sun, Nov 13, 2005 at 07:30:58AM -0500, [EMAIL PROTECTED] wrote:
> Or even better, is there any way to write a user defined function that
> could do the ordering and limiting internally to reduce the data set
> early? I suppose I could do it
On Sun, Nov 13, 2005 at 07:30:58AM -0500, [EMAIL PROTECTED] wrote:
> Nathan Kurz <[EMAIL PROTECTED]> wrote:
> >
> > SELECT uid, match("complex", "function", vector) AS match FROM vectors
> > ORDER BY match DESC LIMIT 20;
>
> SELECT uid, mx FROM
> (SELECT uid, match(...) AS mx FROM vector
Nathan Kurz <[EMAIL PROTECTED]> wrote:
>
> SELECT uid, match("complex", "function", vector) AS match FROM vectors
> ORDER BY match DESC LIMIT 20;
SELECT uid, mx FROM
(SELECT uid, match(...) AS mx FROM vectors LIMIT -1)
ORDER BY mx DESC LIMIT 20;
The LIMIT -1 on the subquery is to fake o
According to my understanding of standard SQL, you should be able to say:
SELECT arbitrary_expression() AS bar FROM foo ORDER BY bar;
... and the expression is only evaluated once per row, not twice.
Your actual example seems confusing, since you appear to alias your
'vectors' table to 'match
On Sat, Nov 12, 2005 at 10:01:29PM -0700, Nathan Kurz wrote:
> SELECT uid, match("complex", "function", vector) FROM vectors AS match
> ORDER BY match DESC LIMIT 20;
Please pardon the silly typo. I do have the AS in the right spot.
SELECT uid, match("complex", "function", vector) AS match F
Hello --
I'm trying to figure out how to optimize a query a bit, and think I've
hit a case that could easily be optimized by sqlite but isn't. I'm
wondering if it would be an easy optimization to add, or whether there
is some way I can 'hint' the optization into being.
I'm using a computationall
16 matches
Mail list logo