Hi there,
SQLite is a perfect fit for a logger, the only question I have is once
it is in production my database will grow rapidly, how can I implement /
mimic a type of rotating log?
So in my mind I am thinking that perhaps I can LIMIT the size of the
SQLIte DB to say 5 MB? And once the DB
On Tue, May 10, 2011 at 10:09 AM, Lynton Grice
lynton.gr...@logosworld.comwrote:
So in my mind I am thinking that perhaps I can LIMIT the size of the
SQLIte DB to say 5 MB? And once the DB reaches that size it starts
INSERTING new logs over the earliest records in the database?
Is this
Hi Lynton,
I don't think sqlite (or any SQL database, for that matter) is a perfect fit
for a logger, because there is a certain amount of write overhead.
Why do you think you would want to do this?
/eno
On 10.05.2011, at 10:09, Lynton Grice wrote:
Hi there,
SQLite is a perfect fit for
On Tue, May 10, 2011 at 11:52 AM, Enrico Thierbach e...@open-lab.org wrote:
I don't think sqlite (or any SQL database, for that matter) is a perfect
fit for a logger, because there is a certain amount of write overhead.
Why do you think you would want to do this?
ALL db insertions in a db
On 10.05.2011, at 12:06, Stephan Beal wrote:
On Tue, May 10, 2011 at 11:52 AM, Enrico Thierbach e...@open-lab.org wrote:
I don't think sqlite (or any SQL database, for that matter) is a perfect
fit for a logger, because there is a certain amount of write overhead.
Why do you think you
Hi Enrico,
Well I have been looking at using a nice light weight C logger.and
played around with LOG4C, Panthious have and also checked out using
syslog-ng, matlog and standard syslogbut in the end decided that for
this specific application an SQLite logger would work well.
I am
Hi Stephan,
Thanks for this, much appreciated. My application is written in pure C,
so I guess I will not be able to use your C++ code?
Chat later
Lynton
On 10/05/2011 12:06, Stephan Beal wrote:
On Tue, May 10, 2011 at 11:52 AM, Enrico Thierbache...@open-lab.org wrote:
I don't think
Hi all,
Thanks for your comments...much appreciated..
BTW: if I am using SQLIte as a logger, what PRAGMA statement can I use
to say FIX the sqlite database size to say 5 MB?
Also, lets say I have a AUTOINCREMENT INTEGER PRIMARY KEY, what will
happen when it reaches 5 MB? Will it just
On Tue, May 10, 2011 at 12:35 PM, Lynton Grice
lynton.gr...@logosworld.comwrote:
Thanks for this, much appreciated. My application is written in pure C,
so I guess I will not be able to use your C++ code?
It's actually just a thin coating over C, and the whole class is quite
small, so it
On May 10, 2011 4:09 PM, Lynton Grice lynton.gr...@logosworld.com wrote:
Hi there,
how can I implement /
mimic a type of rotating log?
So in my mind I am thinking that perhaps I can LIMIT the size of the
SQLIte DB to say 5 MB? And once the DB reaches that size it starts
INSERTING new
On 10 May 2011, at 11:42am, Lynton Grice wrote:
BTW: if I am using SQLIte as a logger, what PRAGMA statement can I use
to say FIX the sqlite database size to say 5 MB?
There isn't one. SQLite would not know which records to delete.
Also, lets say I have a AUTOINCREMENT INTEGER PRIMARY
Hey guys.
I'm sure that this is to do with the way I am using SQLite. I do not
have time to radically change my methodology at this point, but I do
need to fix a rather severe memory leak I'm having.
(My apologies for the code)
Any help is much appreciated.
I query like this:
int
On Tue, May 10, 2011 at 2:17 PM, Ian Hardingham i...@omroth.com wrote:
I'm sure that this is to do with the way I am using SQLite. I do not
have time to radically change my methodology at this point, but I do
need to fix a rather severe memory leak I'm having.
i don't see any immediate leaks
#1 I don't see where you're freeing m_szErrorString (not real sure if it gets
malloc'd on success) -- but you do need to free it on errors for sure.
And where's your Callback function? Why are you calling SaveResultSet (which
you also don't show)? That should probably be done inside the
El mar, 10-05-2011 a las 12:34 +0100, Simon Slavin escribió:
On 10 May 2011, at 11:42am, Lynton Grice wrote:
BTW: if I am using SQLIte as a logger, what PRAGMA statement can I use
to say FIX the sqlite database size to say 5 MB?
There isn't one. SQLite would not know which records to
On 10 May 2011, at 1:57pm, Lauri Nurmi wrote:
El mar, 10-05-2011 a las 12:34 +0100, Simon Slavin escribió:
On 10 May 2011, at 11:42am, Lynton Grice wrote:
BTW: if I am using SQLIte as a logger, what PRAGMA statement can I use
to say FIX the sqlite database size to say 5 MB?
There isn't
Hello,
I have been using memory-based databases (opened via :memory:) and performance
is great. However, one of the things I assumed with memory-based databases was
that memory usage would be higher than the temporary or persistent databases
stored on disk. Is this true, or is the memory usage
Why not use INSERT OR REPLACE to your advantage?
If you set the maximum number of log entries you wanted to keep, then kept
track of your log insert statement, you could wrap by
int this_log_entry_id=1; //initialize.. actually could be initialized by
getting the log entry id of the min date in
A round robin queue is fine. Every so often, to kill off old records do
SELECT max(rowid) FROM myTable
then in your code subtract from it however many rows you want to keep, then do
DELETE FROM myTable WHERE rowid firstToRetain
It won't work perfectly but it's simple and fast.
Or just a function to return the size of the current DB. Mind you,
automatically deleting rows from a log table isn't enough: you may
have to periodically VACUUM the DB, or you may have to setup
auto_vacuum (and incremental_vacuum).
I have code like this in one DB:
CREATE TABLE IF NOT EXISTS
Why not have TWO tables? Log_A and Log_B?
When Log_A is full, DELETE everything from Log_B and start logging to it. When
Lob_B is full, DELETE everything from Log_A and start logging to it again.
If you want, while logging to one, the other can be archived ...
--- On Tue, 5/10/11, Simon
Is this true, or is the memory usage pretty much similar?
Until you reach limit set by 'pragma cache_size' memory usage would be
the same for in-memory database and on-disk database. When the size of
your database grows beyond 'pragma cache_size' in-memory database
starts to consume more memory
Thanks Pavel!
-- Tito
On May 10, 2011, at 11:12 AM, Pavel Ivanov wrote:
Until you reach limit set by 'pragma cache_size' memory usage would be
the same for in-memory database and on-disk database. When the size of
your database grows beyond 'pragma cache_size' in-memory database
starts to
Hi Simon,
Thanks for the feedback below, I will write some delete logic to run
from time to time...;-)
Lynton
On 10/05/2011 13:34, Simon Slavin wrote:
On 10 May 2011, at 11:42am, Lynton Grice wrote:
BTW: if I am using SQLIte as a logger, what PRAGMA statement can I use
to say FIX the
Hi Enrico,
I like the ON INSERT trigger.good idea. So perhaps you have a
setLogMaxSize type function in C that allows the client program to say
hey, I only want the log to hold a max of 10 000 records.and then
I do a select count(*) inside the ON INSERT type trigger and delete
On Tue, May 10, 2011 at 4:32 PM, Lynton Grice
lynton.gr...@logosworld.comwrote:
I like the ON INSERT trigger.good idea. So perhaps you have a
setLogMaxSize type function in C that allows the client program to say
hey, I only want the log to hold a max of 10 000 records.and then
I do a
Hey NIco,
Now this is great.in fact I was playing with an update hook the
other dayand was going to put the deletion logic under the
SQLITE_INSERT below
But your code looks better ;-) Thanks !
void update_callback( void* udp, int type, const char* db_name, const
char* tbl_name,
Yup, fair enough...what I think would be better is to have s
variable set called something like history_retain_time (like Nico
said)..and perhaps a log_check_interval in DAYS or HOURS or
MINUTESwhatever suits the application.
Then perhaps on each insert you get the code to
On Tue, May 10, 2011 at 12:42:14PM +0200, Lynton Grice scratched on the wall:
Hi all,
Thanks for your comments...much appreciated..
BTW: if I am using SQLIte as a logger, what PRAGMA statement can I use
to say FIX the sqlite database size to say 5 MB?
PRAGMA max_page_count = N
Without a view (but with a trigger) and certainly open to improvement
(9 is the
MAX_ENTRIES parameter):
CREATE TABLE log (
id INTEGER NOT NULL PRIMARY KEY ON CONFLICT REPLACE AUTOINCREMENT,
seq INTEGER CONSTRAINT ix1Seq UNIQUE ON CONFLICT REPLACE,
data CHAR);
CREATE TRIGGER trInsLog
On Tue, May 10, 2011 at 12:00 PM, Jay A. Kreibich j...@kreibi.ch wrote:
I guess I am looking for a round robin queue here?
I'd do something like this. This keeps a constant number of messages
in the log. The msg_id provides a message counter, while the
msg_seq is used to keep the
Hi Jay,
Wow, thanks for your detailed message below.much appreciated ;-)
I will try the PRAGMA and also the msg_seq.great.
Lynton
On 10/05/2011 19:00, Jay A. Kreibich wrote:
On Tue, May 10, 2011 at 12:42:14PM +0200, Lynton Grice scratched on the wall:
Hi all,
Thanks for
If this has already been suggested, I apologize.
Add an integer column with a UNIQUE ON CONFLICT REPLACE constraint.Then
after you figure out how many entries are enough (maxcount), insert each
row, specifying that column as mod((lastinsertrowid()+1),maxcount) or
however you specify a modulus
I am writing an app and plan to embed SQLite in my app as a means to store the
data.
What licensing/copyright statements do I need to make RE SQLite?
TIA!
Don Ireland
___
sqlite-users mailing list
sqlite-users@sqlite.org
On May 10, 2011, at 1:59 PM, Don Ireland wrote:
I am writing an app and plan to embed SQLite in my app as a means to store
the data.
What licensing/copyright statements do I need to make RE SQLite?
Nothing. sqlite, the program, is in the Public Domain. SQLite, the term, is
trademarked.
I have searched the web and I have looked through the subjects of all
the archived posts and I cannot find any examples showing me how to use
the extension_functions.c code in a C/C++ program with sqlite3.c. I
am aware of the compilation instructions included in the
extension_functions.c source
Ok thanks.
Don Ireland
-Original Message-
From: Mr. Puneet Kishor punk.k...@gmail.com
To: General Discussion of SQLite Database sqlite-users@sqlite.org
Sent: Tue, 10 May 2011 2:03 PM
Subject: Re: [sqlite] Licensing and copyright info?
On May 10, 2011, at 1:59 PM, Don Ireland wrote:
I
FWIW, I'm making progress. I've got BEGIN and COMMIT triggers firing,
but there's issues related to auto-commit which imply that I need to
be able to skip -at runtime- the trigger firing that I code with each
OP_Transaction and OP_AutoCommit operation, which I think means I need
a new op, but
On 10 May 2011, at 8:03pm, Mr. Puneet Kishor wrote:
On May 10, 2011, at 1:59 PM, Don Ireland wrote:
I am writing an app and plan to embed SQLite in my app as a means to store
the data.
What licensing/copyright statements do I need to make RE SQLite?
Nothing. sqlite, the program, is
A script was running for a heavy load DB access. As you can see the sql
statement select * from service_table where service_no = '13'; in the log.
There is no rows for service_no 13 or 7 in service_table when it is accessed.
The logic is check the entry is there or not, if not then insert it.
On Tue, May 10, 2011 at 10:15 PM, ChingChang Hsiao
chingchang.hs...@overturenetworks.com wrote:
A script was running for a heavy load DB access. As you can see the sql
statement select * from service_table where service_no = '13'; in the log.
There is no rows for service_no 13 or 7 in
There is a problem for reply in the web. So I resend again. Please neglect the
previous one. It's 3.7.5. Journal mode is delete not WAL.
A script was running for a heavy load DB access. As you can see the sql
statement select * from service_table where service_no = '13'; in the log.
There is
42 matches
Mail list logo