Re: [sqlite] Prefix joins

2012-11-28 Thread Igor Tandetnik
Eleytherios Stamatogiannakis  wrote:
> select * from a,b where a.c1 LIKE b.c1||'%';
> 
> but with the additional guarantee for the optimizer that all pattern
> matching will happen on the postfix and not on the prefix, so the
> optimizer will be able to use an index to do the join.

The closest you can get is something along these lines:

where a.c1 between b.c1 and b.c1 || x'FF';

This should use a full scan on b, and an index on a.c1 if available.
-- 
Igor Tandetnik

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


Re: [sqlite] --prefix

2007-05-29 Thread Dan Kennedy
On Tue, 2007-05-29 at 13:11 -0700, Smith1, Robert E wrote:
> Hi,
> 
>  I am trying to install sqlite3 on Sun Solaris 2.8. I am not root so I
> cannot install to /usr/local.  I start configure with
> --prefix=/ptmp/usr/localto try to get it to install to a different
> directory. But I get the same
> 
> error:
> 
> /ptmp/bld/> make install
> 
> tclsh ../sqlite-3.3.17/tclinstaller.tcl 3.3
> 
> can't create directory "/usr/local/lib/tcl8.4/sqlite3": read-only file
> system

Tcl extensions have to be installed in the Tcl library directory,
in your case, under /usr/local/lib/. So the --prefix option doesn't
apply to the Tcl interface, only to the shell, library and include
files (the stuff you need for C programming).

If you don't care about Tcl, add "--disable-tcl" to the configure
line. If you do need it, you'll have to compile Tcl and install
it somewhere you have write permission. Then use environment
variables (PATH etc.) to make sure configure picks up the right
Tcl installation.

Dan.
 


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] --prefix

2007-05-29 Thread Nikola Miljkovic
[In the message "[sqlite] --prefix" on May 29, 13:11, "Smith1, Robert E" 
writes:]
> Hi,
> 
>  I am trying to install sqlite3 on Sun Solaris 2.8. I am not root so I
> cannot install to /usr/local.  I start configure with
> --prefix=/ptmp/usr/localto try to get it to install to a different
> directory.

This is the correct syntax for what you are trying to do.

> But I get the same
> 
> error:
> 
> /ptmp/bld/> make install
> 
> tclsh ../sqlite-3.3.17/tclinstaller.tcl 3.3
> 
> can't create directory "/usr/local/lib/tcl8.4/sqlite3": read-only file
> system
> 
> while executing
> 
> "file mkdir $LIBDIR/sqlite3"
> 
> (file "../sqlite-3.3.17/tclinstaller.tcl" line 15)
> 
> *** Error code 1
> 
> make: Fatal error: Command failed for target `tcl_install'

I have not done this myself but I think I know what the problem is.

Your sqlite installation is correctly figuring out the prefix
and is being installed in the right place.

There is an additional piece of software that is being installed, though.

It is tclsqlite extension to tcl.
This is probably a shared library and a tcl loader, which reacts to
the "package require tclsqlite" command in tcl.
The question is, where are those being installed.
Since they are being used by tcl and not by sqlite, they get installed
where tcl can see them.
Since you are probably using system wide tclsh and not the one 
(not) installed in /ptmp/usr/local, the system wide one is trying to
install the extension where it will find it.
That is most likely its own library area.
The hint is:
> can't create directory "/usr/local/lib/tcl8.4/sqlite3": read-only file
Try running:  which tclsh
and you will probably find that it is
/usr/local/bin/tclsh8.4
or something like that.

> Is my syntax for --prefix correct and is that supposed to correct the
> above error?

So what is the solution here?

You can run:  make -k install
and it will install everyting that it can, excluding tcl extension.
If you want to run tclsqlite from tcl, you can by hand copy the
shared library which would be placed in: $LIBDIR/sqlite3
somewhere you can write, /ptmp/usr/local/lib perhaps.
Before you run "make -k install", run  "make -n install"  and save
the output, since it will tell you what it was planning to
do with tclsqlite files.

When in the future you want to use tclsqlite from tclsh,
instead of: package require tclsqlite 
you would have to try something like
load /ptmp/usr/local/lib/libtclsqlite3.so

I am sure there are other solutions, but this might get you moving.

> Robert

Nikola


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] --prefix

2007-05-29 Thread James Dennett
Sorry, my mistake: I didn't notice the "ptmp" prefix.  Reminder to self:
don't post without a proper night's sleep.

We install SQLite3 to a custom path here (on Solaris, without Tcl
support enabled) with no problem, so I don't know what's happening in
your situation.

-- James

> -Original Message-
> From: Smith1, Robert E [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 29, 2007 1:48 PM
> To: sqlite-users@sqlite.org
> Subject: RE: [sqlite] --prefix
> 
> Why isn't it trying to install to /ptmp/usr/local since that is the
> value I gave --prefix??
> 
> -Original Message-
> From: James Dennett [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 29, 2007 1:44 PM
> To: sqlite-users@sqlite.org
> Subject: RE: [sqlite] --prefix
> 
> > -Original Message-
> > From: Smith1, Robert E [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, May 29, 2007 1:12 PM
> > To: sqlite-users@sqlite.org
> > Subject: [sqlite] --prefix
> >
> > Hi,
> >
> >  I am trying to install sqlite3 on Sun Solaris 2.8. I am not root so
I
> > cannot install to /usr/local.  I start configure with
> > --prefix=/ptmp/usr/localto try to get it to install to a
different
> > directory. But I get the same
> >
> > error:
> >
> > /ptmp/bld/> make install
> >
> > tclsh ../sqlite-3.3.17/tclinstaller.tcl 3.3
> >
> > can't create directory "/usr/local/lib/tcl8.4/sqlite3": read-only
file
> > system
> >
> > while executing
> >
> > "file mkdir $LIBDIR/sqlite3"
> >
> > (file "../sqlite-3.3.17/tclinstaller.tcl" line 15)
> >
> > *** Error code 1
> >
> > make: Fatal error: Command failed for target `tcl_install'
> >
> >
> >
> > Is my syntax for --prefix correct and is that supposed to correct
the
> > above error?
> 
> Looks like it's correct syntax, and that it's doing the right thing
and
> attempting to install under /usr/local -- but that the user account
> you're using lacks permission to write there, possibly because
> /usr/local is mounted as read-only (hence the "read-only file system"
> message).
> 
> -- James
> 
> 
> 
> 
> 
>

> -
> To unsubscribe, send email to [EMAIL PROTECTED]
>

> -
> 
> 
>

--
> ---
> To unsubscribe, send email to [EMAIL PROTECTED]
>

--
> ---


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] --prefix

2007-05-29 Thread Alexander Smondyrev

I've run into a similar problem today and as far as I can see it has
something to do with tcl extensions. If I run configure using --disable-tcl,
then my 'make install' puts everything into the location specified using
prefix. But in the case of tcl extensions 'make install' attempts to put
something with other tcl files. Do correct me if I am wrong.

  - Alex


RE: [sqlite] --prefix

2007-05-29 Thread Smith1, Robert E
Why isn't it trying to install to /ptmp/usr/local since that is the
value I gave --prefix??

-Original Message-
From: James Dennett [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 29, 2007 1:44 PM
To: sqlite-users@sqlite.org
Subject: RE: [sqlite] --prefix

> -Original Message-
> From: Smith1, Robert E [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 29, 2007 1:12 PM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] --prefix
> 
> Hi,
> 
>  I am trying to install sqlite3 on Sun Solaris 2.8. I am not root so I
> cannot install to /usr/local.  I start configure with
> --prefix=/ptmp/usr/localto try to get it to install to a different
> directory. But I get the same
> 
> error:
> 
> /ptmp/bld/> make install
> 
> tclsh ../sqlite-3.3.17/tclinstaller.tcl 3.3
> 
> can't create directory "/usr/local/lib/tcl8.4/sqlite3": read-only file
> system
> 
> while executing
> 
> "file mkdir $LIBDIR/sqlite3"
> 
> (file "../sqlite-3.3.17/tclinstaller.tcl" line 15)
> 
> *** Error code 1
> 
> make: Fatal error: Command failed for target `tcl_install'
> 
> 
> 
> Is my syntax for --prefix correct and is that supposed to correct the
> above error?

Looks like it's correct syntax, and that it's doing the right thing and
attempting to install under /usr/local -- but that the user account
you're using lacks permission to write there, possibly because
/usr/local is mounted as read-only (hence the "read-only file system"
message).

-- James






-
To unsubscribe, send email to [EMAIL PROTECTED]

-


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] --prefix

2007-05-29 Thread James Dennett
> -Original Message-
> From: Smith1, Robert E [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 29, 2007 1:12 PM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] --prefix
> 
> Hi,
> 
>  I am trying to install sqlite3 on Sun Solaris 2.8. I am not root so I
> cannot install to /usr/local.  I start configure with
> --prefix=/ptmp/usr/localto try to get it to install to a different
> directory. But I get the same
> 
> error:
> 
> /ptmp/bld/> make install
> 
> tclsh ../sqlite-3.3.17/tclinstaller.tcl 3.3
> 
> can't create directory "/usr/local/lib/tcl8.4/sqlite3": read-only file
> system
> 
> while executing
> 
> "file mkdir $LIBDIR/sqlite3"
> 
> (file "../sqlite-3.3.17/tclinstaller.tcl" line 15)
> 
> *** Error code 1
> 
> make: Fatal error: Command failed for target `tcl_install'
> 
> 
> 
> Is my syntax for --prefix correct and is that supposed to correct the
> above error?

Looks like it's correct syntax, and that it's doing the right thing and
attempting to install under /usr/local -- but that the user account
you're using lacks permission to write there, possibly because
/usr/local is mounted as read-only (hence the "read-only file system"
message).

-- James


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Prefix searching for fts2.

2007-05-01 Thread Scott Hess

On 5/1/07, Samuel R. Neff <[EMAIL PROTECTED]> wrote:

One suggestion though, instead of (or in addition to) using '*' as the
prefix operator perhaps '%' would be more appropriate in order to be closer
to the LIKE operator.


Hmm.  I was mainly just doing what other groups appear to do (Lucene,
MYSQL, MS SQL).  Using % would also make sense.  Obviously it would
also be nice to have ?/_, and to allow any of those be be embedded
(though the term would still need to be anchored with a real letter at
the front).  I'd also like to be able to do queries on the terms
themselves.

Thanks,
scott

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Prefix searching for fts2.

2007-05-01 Thread Samuel R. Neff
This is great!  The main reason we decided not to use FTS in our project was
lack of prefix searching.  With this new functionality we'll probably switch
to using FTS in a future update.

One suggestion though, instead of (or in addition to) using '*' as the
prefix operator perhaps '%' would be more appropriate in order to be closer
to the LIKE operator.

Best regards,

Sam 


---
We're Hiring! Seeking a passionate developer to join our team building
products. Position is in the Washington D.C. metro area. If interested
contact [EMAIL PROTECTED]
 
-Original Message-
From: Scott Hess [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 01, 2007 2:36 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] Prefix searching for fts2.

I just finished ( http://www.sqlite.org/cvstrac/chngview?cn=3893 )
checking in a string of changes to fts2.c to provide prefix search.
This works like:

...

-scott


-
To unsubscribe, send email to [EMAIL PROTECTED]
-