Re: [sqlite] Strange execution times

2006-02-23 Thread John Stanton
Ulrich, all improvements in knowledge start with curiosity, our most 
precious asset.

JS

Ulrich Schöbel wrote:

Hi John,

there isn't really much to remove, but nevertheless I
followed your advice and replaced the sqlite select
by a small standard tcl procedure. Maybe that set me
on the right track.

There were also some exceptionally high execution
times in between, but not in every test run and not
always at the same repetition count. Those peaks
had a slight tendency to occur at 500, 1000 and
5000 repetitions. From time to time they occured at
other counts or not at all.

I have a couple of daemons running on the machine,
doing several things at more or less arbitrary moments.
I suspect them to be the reason for this behaviour.

One thing still boggles me: The peaks in my timing
experiments with sqlite are reproducibly at a constant
repetition count with approximately predictible times,
as opposed the 'statistical' peaks in the sqlite-less
case.

Unless someone comes up with a similar timing description,
I herewith declare this 'dilemma' solved.

Thank you all for your help and sorry for the alarm.

Kind regards

Ulrich

On Wednesday 22 February 2006 23:41, John Stanton wrote:


Ulrich, try designing an experiment which removes SQLITE and measures
the performance of the other software layers.  That might resolve your
dilemma.
JS





Re: [sqlite] alter table syntax ?

2006-02-23 Thread Kurt Welgehausen
"Doug Fajardo" <[EMAIL PROTECTED]> wrote:

> Help!
> I keep getting a syntax error from the 'alter table' sql command, when
> used to add a column to a table. Can someone help with this error? Below
> is an example of one attempt, and its results:
>
> [tuna]$ sqlite test2.db
> SQLite version 2.8.16
> Enter ".help" for instructions
> sqlite> create table x1 ( name );
> sqlite> alter table x1 add column ( phone );
> SQL error: near "alter": syntax error
> sqlite>

There's no  statement in Sqlite v2.x;
switch to v3 if you need it.

Regards


[sqlite] alter table syntax ?

2006-02-23 Thread Doug Fajardo
Help!
I keep getting a syntax error from the 'alter table' sql command, when
used to add a column to a table. Can someone help with this error? Below
is an example of one attempt, and its results:

[tuna]$ sqlite test2.db
SQLite version 2.8.16
Enter ".help" for instructions
sqlite> create table x1 ( name );
sqlite> alter table x1 add column ( phone );
SQL error: near "alter": syntax error
sqlite>


Re: [sqlite] Trigger and Tree Problem

2006-02-23 Thread Jim C. Nasby
Not sure if there's a way with your current code, but if you use either
an LTREE or nested sets you'd be able to detect this situation quite
easily. There was a discussion about both on the list about 2 weeks ago.

On Thu, Feb 23, 2006 at 05:13:37PM +0100, Thorsten Kortmann wrote:
> sorry for my english..
> 
> i have two tables:
> 
> 1. GROUP
>id
>description
>is_subgroup
> 
> 2. GROUPDETAIL
>id
>groups_id
>remote_id
>remote_type
> 
> - each group can have 1 to x groupdetail.
> - groupdetail.remote_type can have two values, 0 and 1
>   if it is 0, remote_id points to a product
>   if it is 1, remote_id points to a group (where is_subgroup=1)
> 
> The is_subgroup problem is fixed by this trigger:
> I only can point to (sub)groups.
> 
> CREATE TRIGGER bupdate_groupdetail BEFORE UPDATE ON groupdetail
> FOR EACH ROW BEGIN
> SELECT RAISE(ROLLBACK, 'error...')
>   WHERE new.remote_type = 1
>   AND (SELECT id FROM group WHERE id = new.remote_id
>   AND is_subgroup = 1) IS NULL;
> END;
> 
> But i can point to (sub)groups that allready part of the same path.
> In this way i get an endless recursion (1).
> 
>  GROUP-->SUB-->SUB-->SUB-->PRODUCT
>   | | |
>   +-<-1-+ +--->SUB-->PRODUCT
> 
> Is there a way to check all parent (sub)groubs inside a trigger?
> 
> HTH
>  Thorsten
> 

-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461


[sqlite] Trigger and Tree Problem

2006-02-23 Thread Thorsten Kortmann

sorry for my english..

i have two tables:

1. GROUP
   id
   description
   is_subgroup

2. GROUPDETAIL
   id
   groups_id
   remote_id
   remote_type

- each group can have 1 to x groupdetail.
- groupdetail.remote_type can have two values, 0 and 1
  if it is 0, remote_id points to a product
  if it is 1, remote_id points to a group (where is_subgroup=1)

The is_subgroup problem is fixed by this trigger:
I only can point to (sub)groups.

CREATE TRIGGER bupdate_groupdetail BEFORE UPDATE ON groupdetail
FOR EACH ROW BEGIN
SELECT RAISE(ROLLBACK, 'error...')
WHERE new.remote_type = 1
AND (SELECT id FROM group WHERE id = new.remote_id
AND is_subgroup = 1) IS NULL;
END;

But i can point to (sub)groups that allready part of the same path.
In this way i get an endless recursion (1).

 GROUP-->SUB-->SUB-->SUB-->PRODUCT
  | | |
  +-<-1-+ +--->SUB-->PRODUCT

Is there a way to check all parent (sub)groubs inside a trigger?

HTH
 Thorsten