> > That works but what do you sort by to get the entries in order?
>
> You can either just use a simple sequence and then delete where sequence
> mod = 0 (hrm... does sqlite support
> functional indexes?), or just add a timestamp to the table.
most people that implement a ring buffer are
On Mon, Jan 09, 2006 at 09:19:00AM -0600, Jay Sprenkle wrote:
> > A guy on this end had a suggestion that I kicked myself for not
> > thinking of earlier: Use a simple numeric ID that you mod by the number
> > of records you want, automatically overwriting the oldest record when a
> > new one
> A guy on this end had a suggestion that I kicked myself for not
> thinking of earlier: Use a simple numeric ID that you mod by the number
> of records you want, automatically overwriting the oldest record when a
> new one comes along.. I may have to put together a smallish trigger to
> keep
Julien LEFORT wrote:
Hi,
I would like to implement a log table with a finite dimension, for exemple a
table with 500 records, and when the last record is set in the table I would
like to come back at the first tuplet and write over the previous value
recorded. I think it's the way SQLite
TECTED]
> Sent: 24 December 2005 10:44
> To: sqlite-users@sqlite.org
> Subject: RE: [sqlite] ring buffer table
>
>
> oops, just realised that doesn't work when you get further than 10.
>
>
> > -Original Message-
> > From: Richard B. Boulton [mailto:[E
oops, just realised that doesn't work when you get further than 10.
> -Original Message-
> From: Richard B. Boulton [mailto:[EMAIL PROTECTED]
> Sent: 24 December 2005 10:37
> To: sqlite-users@sqlite.org
> Subject: RE: [sqlite] ring buffer table
>
>
> If you use
If you used an INTEGER PRIMARY KEY AUTOINCREMENT could you use a simple trigger
and a modulus of the newly inserted rowid?
e.g. for a dimension of 10:
CREATE TABLE ring_buffer (key INTEGER PRIMARY KEY AUTOINCREMENT, stuff TEXT);
CREATE TRIGGER delete_tail AFTER INSERT ON ring_buffer
BEGIN
-Original Message-
From: Paul Bohme [mailto:[EMAIL PROTECTED]
Sent: Friday, December 23, 2005 2:10 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] ring buffer table
Cory Nelson wrote:
>afaik, sqlite doesn't store row counts so count(*) causes a full table
scan.
>
>On
tities, thus I didn't really expect SQLite to
have it.
-Original Message-
From: Paul Bohme [mailto:[EMAIL PROTECTED]
Sent: Viernes, 23 de Diciembre de 2005 02:52 p.m.
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] ring buffer table
Julien LEFORT wrote:
Hi,
I would like to imp
n maintaning a
> separate table for the counters.
>
> -Original Message-
> From: Paul Bohme [mailto:[EMAIL PROTECTED]
> Sent: Viernes, 23 de Diciembre de 2005 02:52 p.m.
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] ring buffer table
>
> Julien LEFORT wrote:
>
p.m.
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] ring buffer table
Julien LEFORT wrote:
>Hi,
>I would like to implement a log table with a finite dimension, for exemple
a
>table with 500 records, and when the last record is set in the table I
would
>like to come back at the
Julien LEFORT wrote:
Hi,
I would like to implement a log table with a finite dimension, for exemple a
table with 500 records, and when the last record is set in the table I would
like to come back at the first tuplet and write over the previous value
recorded. I think it's the way SQLite
implement a trigger that count the number of rows :
if count(rows) = 500
then delete the first row
Julien LEFORT wrote:
Hi,
I would like to implement a log table with a finite dimension, for exemple a
table with 500 records, and when the last record is set in the table I would
like to come
Hi,
I would like to implement a log table with a finite dimension, for exemple a
table with 500 records, and when the last record is set in the table I would
like to come back at the first tuplet and write over the previous value
recorded. I think it's the way SQLite journal is implmented.
Is
14 matches
Mail list logo