> > 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 wanting
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 com
> 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 th
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 jour
|Stuff 11
12|Stuff 12
13|Stuff 13
14|Stuff 15
15|Stuff 16
16|Stuff 17
17|Stuff 18
18|Stuff 19
19|Stuff 20
20|Stuff 21
> -Original Message-
> From: Richard B. Boulton [mailto:[EMAIL PROTECTED]
> Sent: 24 December 2005 10:44
> To: sqlite-users@sqlite.org
> Subject: RE: [sqlit
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 yo
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
DELE
-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.
>
&
r other entities, 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 woul
than 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 jour
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 b
13 matches
Mail list logo