Try using lsof.
Chase wrote:
is there any way (in c/c++) to find out how many current connections
there are to a database that i am connected to?
i'd like to do some housekeeping on the database every so often, but
only if there's no one else connected to it at the time.
any ideas?
thank
Forget about the alternate insert statements I suggested.
Assuming "id" is declared INTEGER PRIMARY KEY in all tables,
you can't get better performance than this in a single
insert statement:
insert into x select x1.* from a.x x1, y where x1.id = y.id;
Joe,
Yes I have temp_store = memory... I think during the compilation of the
library.
I don't think I need the order by clause but I'll try it just to see if it
helps...
The original table is created and stored in sorted order so just a plain
select returns sorted rows.
I'll
Thanks Joe!! It works now!!
Daniel.
On Sun, 2007-08-12 at 09:56 -0700, Joe Wilson wrote:
> You probably have another shared sqlite library in your path somewhere.
>
> Explicitly link with /absolute/directory/to/your/libsqlite.a rather than
> -lsqlite.
>
> --- Daniel Berenguer <[EMAIL PROTECTED]
--- Joe Wilson <[EMAIL PROTECTED]> wrote:
> This should be faster:
>
> insert into x
> select * from a.x x1
> where exists (select 1 from Y where x1.id = y.id);
>
> See if adding an order by statement will make it faster by speeding
> up the inserts:
>
> insert into x
> select * from a
This should be faster:
insert into x
select * from a.x x1
where exists (select 1 from Y where x1.id = y.id);
See if adding an order by statement will make it faster by speeding
up the inserts:
insert into x
select * from a.x x1
where exists (select 1 from Y where x1.id = y.id)
orde
You probably have another shared sqlite library in your path somewhere.
Explicitly link with /absolute/directory/to/your/libsqlite.a rather than
-lsqlite.
--- Daniel Berenguer <[EMAIL PROTECTED]> wrote:
> I've downloaded the sqlite-2.8.17 source code in order to create my own
> static library for
Joe,
Thanks for the reply.
The id field is also the Primary Key and no other indices exist. I've run the
explan query plan and they seem optimal, reading table X, and using an index
access into Z.
I just had a thought. It seems to me that doing the insert into X select from
Hi all,
I've downloaded the sqlite-2.8.17 source code in order to create my own
static library for my embedded platform (OpenSlug)
source code package:
sqlite-source-2_8_17.zip
Ok, I get to cross-compile the static library (libsqlite.a) using this
simple makefile:
include ../Makefile_opnode.in
OK, that fixes it on the commandline. Now to figure out how to link
against the new version...
Joe Wilson wrote:
Time to upgrade.
--- Christopher Backhouse <[EMAIL PROTECTED]> wrote:
I repeated exactly what you have there and confirm it doesn't work for me.
[EMAIL PROTECTED]:/tmp$ sqlite3 te
Workaround for 3.3.13:
select distinct bar, baz as z from foo where bar in ((
select bar from foo where baz==z order by length(bar) desc limit 1
));
It's just different enough to prevent sqlite 3.3.13 from choking on
the "order by" clause in the "in" subquery.
--- Christopher Backhouse <[EM
Time to upgrade.
--- Christopher Backhouse <[EMAIL PROTECTED]> wrote:
> I repeated exactly what you have there and confirm it doesn't work for me.
>
> [EMAIL PROTECTED]:/tmp$ sqlite3 testing
> SQLite version 3.3.13
> Enter ".help" for instructions
> sqlite> CREATE TABLE foo(bar text, baz text);
>
I repeated exactly what you have there and confirm it doesn't work for me.
[EMAIL PROTECTED]:/tmp$ sqlite3 testing
SQLite version 3.3.13
Enter ".help" for instructions
sqlite> CREATE TABLE foo(bar text, baz text);
sqlite> INSERT INTO "foo" VALUES('123','345');
sqlite> INSERT INTO "foo" VALUES('12
--- Christopher Backhouse <[EMAIL PROTECTED]> wrote:
> I have a table:
> create table foo(bar text,baz text);
>
> I want to produce a list of all bar's paired with the longest baz they
> are ever associated with. I came up with the following query:
>
> select distinct bar,baz as z from foo where
I have a table:
create table foo(bar text,baz text);
I want to produce a list of all bar's paired with the longest baz they
are ever associated with. I came up with the following query:
select distinct bar,baz as z from foo where bar in (select bar from foo
where baz==z order by length(bar) d
Igor Mironchick <[EMAIL PROTECTED]>
wrote:
If I attach database "db_attached" into "db" and then close "db".
After opening "db" does I need to attach "db_attached" again or this
attachment was stored???
Attachment is a property of database connection, it is not reflected in
the physical databa
Hi, guys.
If I attach database "db_attached" into "db" and then close "db". After
opening "db" does I need to attach "db_attached" again or this
attachment was stored???
--
Regards,
Igor Mironchick,
Intervale ©
#ICQ 492-597-570
---
On 11 Aug, Gerry Snyder wrote:
> fred238 wrote:
>> Gerry Snyder a écrit :
>>> fred238 wrote:
Is necessary to set column datatype in sqlite3 ?
Is better to use class storage in sqlite3 (TEXT, NUMERIC, INTEGER,
REAL, NONE) ?
>>> Check out http://www.sqlite.org/datatype3.html and
18 matches
Mail list logo