Re: [sqlite] Last record

2019-10-15 Thread Philippe RIO
The only way is to make a query for getting the number of records and in the
second query I have to count the number of records retrieved to know if it
is the last one.

Thank you for the quick answer.



-

Kenavo

https://md5finder.blogspot.com/
(Never be pleased, always improve)
--
Sent from: http://sqlite.1065341.n5.nabble.com/
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Last record

2019-10-15 Thread Philippe RIO
A short question : how could I know if I am reading the last record with
sqlite  (sqlite3_step)? sqlite3_step only returns SQLITE_ROW. Is there a
function for that case which returns SQLITE_DONE? A function which is one
record in advance from sqlite3_step.

Thank every one



-

Kenavo

https://md5finder.blogspot.com/
(Never be pleased, always improve)
--
Sent from: http://sqlite.1065341.n5.nabble.com/
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLITE and the memory

2019-09-09 Thread Philippe RIO
The answer:

I remember : I have 256 databases.
I have an array of 256 columns into which I store the number of record
created. When I insert a record into a table, the corresponding entry into
this array is incremented by one. When this element is equal to 1000 I
commit the transaction. Not all the the parts of the array are filled at the
same time, In that case the memory used grows. I had forgotten to commit
many transaction for which the values into the array was less than 1000. Now
rather than using 2Gb I only needs less than 1Gb wich is which is partially
released. It will be released when the tables will be closed.

hereis the code to see what I am writing :



 

My last test for inserting 10 000 000  passwords was good for me. I made it
in 43 minutes.

Thank you for your help.




-

Kenavo

https://md5finder.blogspot.com/
(Never be pleased, always improve)
--
Sent from: http://sqlite.1065341.n5.nabble.com/
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLITE and the memory

2019-09-08 Thread Philippe RIO
I use the windows task manager to see how the memory is used


Opening the 256 tables :
sqlite3_open_v2(_lpszTbl,[__iTableNumber],SQLITE_OPEN_READWRITE|SQLITE_OPEN_FULLMUTEX,NULL);





-

Kenavo

https://md5finder.blogspot.com/
(Never be pleased, always improve)
--
Sent from: http://sqlite.1065341.n5.nabble.com/
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLITE and the memory

2019-09-08 Thread Philippe RIO
Hello,
I have an application composed of 256 databases. Each database occupied 42Mb
for more than 950 000 records into.

[samedi 7 septembre 2019 13:11:45] : Number of passwords stored : 244 152
645
[samedi 7 septembre 2019 13:19:28] : Closing Log file
[samedi 7 septembre 2019 13:19:28] : *** Log Stoped ***

These 42Mb are measured after a Vacuum.
When I lauched my application it only opens the databases (all) and the
memory is filled by 57mb just for SQLITE !
When I launch a treatment to generate random passwords the memory is filled
at 87% (>2Gb).
I would like to reduce this used memory but I don't know how.

I have the following pragmas :

main.page_size=65536
wal_autocheckpoint=0
encoding "UTF_8"
temp_store=FILE
case_sensitive_like=TRUE
foreign_keys=OFF
legacy_file_format=OFF
cache_size=-200
main.cache_size=-200
main.auto_vacuum=NONE
main.journal_mode=OFF
main.secure_delete=OFF
main.synchronous=OFF
main.locking_mode=EXCLUSIVE
main.user_version=230714the data
main.application_id=241259
shrink_memory

Some pragmas have a sense when creating the database and the other when
creating the tables.

I have recompiled SQLITE with the following options :

SQLITE_ENABLE_COLUMN_METADATA = 1
SQLITE_THREAD_SAFE = 2
SQLITE_DEFAULT_MEMSTATUS = 0
SQLITE_DEFAULT_FILE_FORMAT = 4
SQLITE_DEFAULT_PCACHE_INITSZ = 0
SQLITE_WIN32_MALLOC = 1
SQLITE_TEMP_STORE = 0
SQLITE_CASE_SENSITIVE_LIKE = 1
SQLITE_ENABLE_API_ARMOR 1
SQLLITE_ENABLE_FTS3 = 1
SQLLITE_ENABLE_FTS3_PARENTHESIS = 1
SQLLITE_ENABLE_FTS3_TOKENIZER = 1
SQLLITE_ENABLE_FTS4 = 1
SQLLITE_ENABLE_FTS5 = 1
SQLLITE_ENABLE_GEOPOLY = 1
SQLLITE_ENABLE_DESERIALIZE = 1
SQLLITE_ENABLE_JSON1 = 1
SQLLITE_ENABLE_MEMORY_MANAGEMENT = 1
SQLLITE_ENABLE_RTREE = 1
SQLLITE_ENABLE_ENABLE_SESSION = 1
SQLLITE_ENABLE_SOUNDEX = 1

The software is running under W7 Pro
I have no problem with it, I find it very fast.
See my blog at https://md5finder.blogspot.com/2019/08/md5finder.html
But this memory used/consummed is really a problem.
I have a small machine with only 3Gb of RAM and only one program needs 87% !
How to reduce that.

I would appreciate some help.
Thank You

Philippe RIO



-

Kenavo

https://md5finder.blogspot.com/
(Never be pleased, always improve)
--
Sent from: http://sqlite.1065341.n5.nabble.com/
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users