Re: [sqlite] sqlite3_prepare memory leak

2008-11-05 Thread Bartosz Wiklak
Hi,

Sherief, thank you for our kind help.
I really did use globals.
I found a way to run DumpMemorLeaks after all globals and static
variables are deallocated, I used
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);

I made some malloc and new leaks around the code I'm interested in to
see if it works - worked great, but I found
NO leaks in sqlite sqlite3_prepare.

I'm not sure if it means that there is an error in Deleaker or
CrtDumpMemoryLeaks doesn't report mallocs from DLL ( i bet on Deleaker
because it claims that there is a leak in heap so CrtDumpMemoryLeaks
should show this  ).

How do you think?

Bartek

On Wed, Nov 5, 2008 at 5:58 PM, Sherief N. Farouk <[EMAIL PROTECTED]> wrote:
>> I really don't see any way to use  _CrtDumpMemoryLeaks(). It always
>> shows hundreds of blocks even if I'm sure that nothing was allocated
>> (no malloc or new). I know that this is not a place to learn how to
>> use VC++. Maybe it's true that Deleaker just freaks out. I will try to
>> track it down another way. All ideas appreciated.
>>
>> Bartek
>
> TFM should be helpful. Do something like:
>
> Int main()
> {
>//Note the extra scope..
>{
>//...app work goes here
>}
>_CrtDumpMemoryLeaks(); //I hope you're not using globals, if so
> deallocate them before this call.
>Return 0;
> }
>
> Watch the output window, and if leaks are detected (and your app's
> allocation behavior is pretty deterministic), _CrtSetBreakAlloc() is you
> best friend.
>
> - Sherief
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Delete based on timestamp very slow

2008-11-05 Thread dbikash

Hello,

My database contains a 'time' field where I am storing the unix epoch
timestamp (generating programmatically using time() function in a C/Linux
environment). Hence the database actually contains records sorted by time,
though there may be multiple records in one time instance. I also have an
index on this time field.

I will have to keep rolling my database such that it contains only 5 days of
data. I also have a restriction on the database size. Therefore I have a
function that gets invoked periodically and decides if any data needs to be
deleted. If yes, it calculates the time from which data will be deleted,
i.e. all records prior to this time can be deleted.

However, the delete command "DELETE FROM table WHERE time < XXX" is very
slow (XXX is in time_t format). VACUUM is even slower. (I need to VACUUM
since I have a restriction on the database size.) My database has 1 million
records and is more than 100 MB in size.

What would be the most optimal way of making the deletion?

I suspect that SQLite might be scanning all rows, though since my records
are ordered on time, once it has found the first record not satisfying the
above condition, it can stop scanning.

Also, if I need to make manual queries on time, I am using something like
"SELECT * FROM table WHERE datetime(time, 'unixepoch', 'localtime') <
'2008:05:04 13:34:45'. Is this the most optimal way of querying (and
storing) the time?

Thanks,
Bikash
-- 
View this message in context: 
http://www.nabble.com/Delete-based-on-timestamp-very-slow-tp20356268p20356268.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-11-05 Thread dbikash

I'm back again.

I could not ignore such a strong suggestion of not using thread. So I am
planning on a single threaded event driven model for my application. I also
plan to use sqlite3_progress_handler() to handle query cancellation.

I compiled SQLite with the flags SQLITE_THREADSAFE=0. Even then, do I need
to link my application with pthread library? I get linking errors like:
sqlite3.c:(.text+0x1c737): undefined reference to 'pthread_mutex_trylock'
...

Thanks,
dbikash


D. Richard Hipp wrote:
> 
> 
> On Nov 3, 2008, at 9:54 AM, Ken wrote:
> 
>> No I would not wrap the querries in a transaction.
>>
>> I think the problem you are encountering is due to thread  
>> interaction upon the sqlite structures. Since it was compiled with  
>> THREADsafety disabled.
>>
>> If you have two threads that share the same connection. You need to  
>> compile with THREADSAFE turned on. Or provide your own mutexing such  
>> that neither thread interacts with the sqlite connection concurrently.
> 
> Note:  when SQLITE_THREADSAFE=0 then it is not safe for two threads to  
> call SQLite under any circumstances, even if they are using completely  
> separate database connections.
> 
> My advice is that you not use threads. Threads are evil.  But,  
> recognizing that you are unlikely to heed this warning, at the very  
> least compile with SQLITE_THREADSAFE=1 if you really think you must  
> use threads.
> 
> D. Richard Hipp
> [EMAIL PROTECTED]
> 
> 
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/%22SQL-logic-error-or-missing-database%22-with-multithreaded-program-tp20266281p20355543.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] look up by row on ordered table... must be very fast

2008-11-05 Thread Ian Walters
Hi,

What I'm trying to do is create an ordered table in SQLite that I can
then look up by row number.  If performance isn't considered this is
actually quite easy.  For example

CREATE TEMPORARY TABLE mytable AS ... complex select statement ordered
by label, recordId ;
CREATE INDEX ON mytable (label, recordId);

SELECT recordId, label FROM mytable ORDER BY label, recordId LIMIT 1
OFFSET row;

However I'm very concerned about performance.  For instance, I don't
want to re prepare the query, so 'row' would need to be a bound value in
the above.  Given that the C++ API for SQLite only has _step, another
worry is that is what OFFSET might do internally.  O(N) lookup per row
isn't good enough.

My other thought was to use ROWID, e.g. "WHERE ROWID = :row", but the
warnings in that documentation seem to indicate it isn't good enough to
use as a row number.

Alternatively suggestions on how to add a row as an explicit column in
the select statement for the temporary table would also be useful.
Again, performance matters.  It doesn't have to be as fast as the row
lookup, but anything involving 'count(*) ' isn't going
to cut it.  Something like 'SELECT ..., rowNumber++ FROM ', although I realize there is no ++ operator in SQLite.

As a side question, if I order the select statement when creating the
table, will that order the inserts, or will that be ignored.  If it
isn't ignored I may be able to do this via a sqlite3_create_function

Thanks in advance for any help,

--
Ian
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [sqlite3] Macports Build Failed

2008-11-05 Thread tharrison

I was able to resolve my instance of this problem by following the
instructions on the MacPorts trac ticket (see the bottom post for
workaround)

https://trac.macports.org/ticket/16571



brent1a wrote:
> 
> I've been trying to get sqlite3 to build on my Mac under macports for
> ages. Any help would be appreciated--
> 
> client-6x-1xx-17-x14:~ brent1a$ sudo port install sqlite3
> --->  Building sqlite3 with target all
> Error: Target org.macports.build returned: shell command " cd
> "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_sqlite3/work/sqlite-3.6.2"
> && gnumake all " returned error 2
> Command output: sqlite3.c:80990: error: 'TK_LSHIFT' undeclared (first use
> in this function)
> sqlite3.c:80993: error: 'TK_LT' undeclared (first use in this function)
> sqlite3.c:80999: error: 'TK_GE' undeclared (first use in this function)
> sqlite3.c:81002: error: 'TK_RSHIFT' undeclared (first use in this
> function)
> sqlite3.c:81005: error: 'TK_GT' undeclared (first use in this function)
> sqlite3.c:81011: error: 'TK_ILLEGAL' undeclared (first use in this
> function)
> sqlite3.c:81020: error: 'TK_BITOR' undeclared (first use in this function)
> sqlite3.c:81023: error: 'TK_CONCAT' undeclared (first use in this
> function)
> sqlite3.c:81028: error: 'TK_COMMA' undeclared (first use in this function)
> sqlite3.c:81032: error: 'TK_BITAND' undeclared (first use in this
> function)
> sqlite3.c:81036: error: 'TK_BITNOT' undeclared (first use in this
> function)
> sqlite3.c:81053: error: 'TK_STRING' undeclared (first use in this
> function)
> sqlite3.c:81056: error: 'TK_ID' undeclared (first use in this function)
> sqlite3.c:81068: error: 'TK_DOT' undeclared (first use in this function)
> sqlite3.c:81076: error: 'TK_INTEGER' undeclared (first use in this
> function)
> sqlite3.c:81082: error: 'TK_FLOAT' undeclared (first use in this function)
> sqlite3.c:81102: warning: assignment makes integer from pointer without a
> cast
> sqlite3.c:81106: error: 'TK_VARIABLE' undeclared (first use in this
> function)
> sqlite3.c:81115: error: 'TK_REGISTER' undeclared (first use in this
> function)
> sqlite3.c:81155: error: 'TK_BLOB' undeclared (first use in this function)
> sqlite3.c: In function 'sqlite3RunParser':
> sqlite3.c:81227: error: 'TK_SPACE' undeclared (first use in this function)
> sqlite3.c:81227: warning: case label value exceeds maximum value for type
> sqlite3.c:81235: error: 'TK_ILLEGAL' undeclared (first use in this
> function)
> sqlite3.c:81235: warning: case label value exceeds maximum value for type
> sqlite3.c:81242: error: 'TK_SEMI' undeclared (first use in this function)
> sqlite3.c:81242: warning: case label value exceeds maximum value for type
> sqlite3.c:81258: warning: comparison between pointer and integer
> sqlite3.c:81259: warning: passing argument 2 of 'sqlite3Parser' makes
> integer from pointer without a cast
> gnumake: *** [sqlite3.lo] Error 1
> 
> Error: Status 1 encountered during processing.
> 
> 
> 
>   
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-sqlite3--Macports-Build-Failed-tp20109344p20349037.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] No module named sqlite3

2008-11-05 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] wrote:
> Thanks for help, But I could not get the point, should I again rebuild the
> python, as this time it will build sqlite3 module also because now SQlite
> is already present on the system.
> Is there any other way by which I can manually load the required module.

I can't give you specific answers since it depends on your machine, the
package management tools, what the vendor provides, what you have
installed, what you have hand compiled etc.  I suggest asking on the
support forums for your OS.

If you compiled Python yourself then you need to reconfigure and
recompile making sure SQLite development libraries are available.  The
Python build process tells you at the end what it couldn't build.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkkSDwAACgkQmOOfHg372QTMMgCfTT8AO1miWHb4Rebx4Fkj61xb
AYgAmQH1n6fe9wcXGX31ttSTgRVqAxwX
=cr42
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Slow INSERT on fast machine, fast INSERT on slow machine

2008-11-05 Thread Griggs, Donald
Regarding: "I found that win function FlushFileBuffers (used by SQLite)
slows down performances,..."

Perhaps you've already seen this message thread from 2005 below.  Maybe
FILE_FLAG_WRITE_THROUGH instead of FlushFileBuffers would benefit your
particular application.  (I don't know what would explain the 10x xp
differences you're finding.)

http://www.mail-archive.com/sqlite-users@sqlite.org/msg08121.html 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Re-title, enhance SQLite FAQ item on Unicode ?

2008-11-05 Thread MikeW
Given the number of recent queries on Unicode character handling in SQLIte,
could I suggest that the existing FAQ item on the subject
http://www.sqlite.org/faq.html#q18

be given a more general title referring to "Unicode; UTF" usage,
and the text & links therein be expanded slightly
e.g. http://www.sqlite.org/cvstrac/fileview?f=sqlite/ext/icu/README.txt

so that 'drive-in' users can get going under their own steam
with the resources on the site?

[Not that I mind posting links to earlier answers ...!]

Best regards,
MikeW

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_prepare memory leak

2008-11-05 Thread Sherief N. Farouk
> I really don't see any way to use  _CrtDumpMemoryLeaks(). It always
> shows hundreds of blocks even if I'm sure that nothing was allocated
> (no malloc or new). I know that this is not a place to learn how to
> use VC++. Maybe it's true that Deleaker just freaks out. I will try to
> track it down another way. All ideas appreciated.
> 
> Bartek

TFM should be helpful. Do something like:

Int main()
{
//Note the extra scope..
{
//...app work goes here
}
_CrtDumpMemoryLeaks(); //I hope you're not using globals, if so
deallocate them before this call.
Return 0;
}

Watch the output window, and if leaks are detected (and your app's
allocation behavior is pretty deterministic), _CrtSetBreakAlloc() is you
best friend.

- Sherief

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Slow INSERT on fast machine, fast INSERT on slow machine

2008-11-05 Thread Sherief N. Farouk
> I found that win function FlushFileBuffers (used by SQLite) slows down
> performances,
> but still don't have explanation why this funcion on some machines
> works 10x slower then on others.
> 
> I have used win xp sp2 on all machines where I have tested the
> behaviour.

Try using CodeAnalyst, see where the time is being spent..

- Sherief

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] row count after a select

2008-11-05 Thread Igor Tandetnik
Ken <[EMAIL PROTECTED]> wrote:
> Igor I disagree, but please feel free to correct me if I'm wrong.
> Consider the following sql statement:
>
> select * from table1 order by last_name;
>
> Sqlite must first order the data since an order by clause is
> specified. (assuming there is no index to utilize).

Yes, in some cases, SQLite might know internally how many rows there are 
by the time the first row is produced. This is not the case in general, 
though. Anyway, as far as I can tell there is no public API to retrieve 
this information even when it's available.

Igor Tandetnik 



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Slow INSERT on fast machine, fast INSERT on slow machine

2008-11-05 Thread Shane Harrelson
Check the third party processes running on the respective machines.   Virus
scanners, file indexing utilities, TortoiseSVN, etc.  have been shown to
adversely affect performance on Windows machines by locking the journal file
at inopportune times.

-Shane

On Wed, Nov 5, 2008 at 6:36 AM, Darko Filipovic <[EMAIL PROTECTED]> wrote:

> I found that win function FlushFileBuffers (used by SQLite) slows down
> performances,
> but still don't have explanation why this funcion on some machines works
> 10x slower then on others.
>
> I have used win xp sp2 on all machines where I have tested the behaviour.
>
>
>
>
> 
> From: Sherief N. Farouk <[EMAIL PROTECTED]>
> To: General Discussion of SQLite Database 
> Sent: Tuesday, November 4, 2008 5:53:16 PM
> Subject: Re: [sqlite] Slow INSERT on fast machine, fast INSERT on slow
> machine
>
>  > The problem is that I'm getting better performance on AMD machine with
> > ATA disk,
> > but 10 times slower on DualCore machine with SATA disk (both disks are
> > at 7200 rpm)...
> > I don't understand the source of this behaviour...
>
> OS? Tried VSTS profiler, VTune or the free CodeAnalyst to look at where the
> time is being spent?
>
> - Sherief
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] LIKE operator to support GREEK

2008-11-05 Thread MikeW
Gerasimos Xydas <[EMAIL PROTECTED]> writes:

> 
> Hello,
> 
> I have built an SQLite 3 database from C code.
> 
> CASE 1
> 
...
> CASE 2
> 
...
> 
> Best regards,
> Gerasimos
> 

Search the newsgroup ... start here
http://thread.gmane.org/gmane.comp.db.sqlite.general/42112

Regards,
MikeW




___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Is there Roadmap

2008-11-05 Thread Shane Harrelson
http://www.sqlite.org/omitted.html

Not a "roadmap", but it does give you a hint about the order of potential
new features.

HTH.
-Shane

On Tue, Nov 4, 2008 at 11:06 PM, Avinash Mittal <[EMAIL PROTECTED]>wrote:

> Hi All,
>
> Is there any roadmap made for SQLite?
> I couldn't found any specific things on wiki or any othere site.
>
> Thanks & Regards
> Avinash
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] row count after a select

2008-11-05 Thread Ken
Igor I disagree, but please feel free to correct me if I'm wrong. Consider the 
following sql statement:

select * from table1 order by last_name;

Sqlite must first order the data since an order by clause is specified. 
(assuming there is no index to utilize). The data must be fetch, sorted and 
stored in a temporary file or in memory.

But without the order by then sqlite does not need to fetch the data prior to 
select. 

So only sometimes does it fetch all data at the first step.

Ken

--- On Wed, 11/5/08, Igor Tandetnik <[EMAIL PROTECTED]> wrote:

> From: Igor Tandetnik <[EMAIL PROTECTED]>
> Subject: Re: [sqlite] row count after a select
> To: sqlite-users@sqlite.org
> Date: Wednesday, November 5, 2008, 7:38 AM
> <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Do you know a way to count the number of rows
> identified by a select
> > statement, just after the first call to sqlite3_step ?
> Of course
> > without fetching the entire result set, nor having to
> systematically
> > add count(*)
> 
> You seem to believe SQLite retrieves the whole resultset on
> the first 
> sqlite3_step call. This is not the case. SQLite produces
> records one by 
> one, on request, every time you call sqlite3_step. It
> simply doesn't 
> know how many there are going to be, until on some
> sqlite3_step call it 
> discovers there are no more.
> 
> Igor Tandetnik 
> 
> 
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] row count after a select

2008-11-05 Thread Igor Tandetnik
"LEMAIRE, Vincent (AUSY FRANCE)"
<[EMAIL PROTECTED]> wrote in
message
news:[EMAIL PROTECTED]
> I just imagined that when the engine calculates a 'count(*)' it
> doesn't loop on each result row "just" for counting

It does, in fact.

Igor Tandetnik 



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] row count after a select

2008-11-05 Thread LEMAIRE, Vincent (AUSY FRANCE)
Thanks Igor,
I just imagined that when the engine calculates a 'count(*)' it doesn't loop on 
each result row "just" for counting,
and thus I thought there could be some function on client side to use that 
supposed algorithm.

-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] la part de Igor Tandetnik
Envoyé : mercredi 5 novembre 2008 14:38
À : sqlite-users@sqlite.org
Objet : Re: [sqlite] row count after a select


<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Do you know a way to count the number of rows identified by a select
> statement, just after the first call to sqlite3_step ? Of course
> without fetching the entire result set, nor having to systematically
> add count(*)

You seem to believe SQLite retrieves the whole resultset on the first 
sqlite3_step call. This is not the case. SQLite produces records one by 
one, on request, every time you call sqlite3_step. It simply doesn't 
know how many there are going to be, until on some sqlite3_step call it 
discovers there are no more.

Igor Tandetnik 



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

This mail has originated outside your organization, either from an external 
partner or the Global Internet.
Keep this in mind if you answer this message.



The information in this e-mail is confidential. The contents may not be 
disclosed or used by anyone other then the addressee. Access to this e-mail by 
anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and 
delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of 
this e-mail as it has been sent over public networks. If you have any concerns 
over the content of this message or its Accuracy or Integrity, please contact 
Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus 
scanning software but you should take whatever measures you deem to be 
appropriate to ensure that this message and any attachments are virus free.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] row count after a select

2008-11-05 Thread Igor Tandetnik
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Do you know a way to count the number of rows identified by a select
> statement, just after the first call to sqlite3_step ? Of course
> without fetching the entire result set, nor having to systematically
> add count(*)

You seem to believe SQLite retrieves the whole resultset on the first 
sqlite3_step call. This is not the case. SQLite produces records one by 
one, on request, every time you call sqlite3_step. It simply doesn't 
know how many there are going to be, until on some sqlite3_step call it 
discovers there are no more.

Igor Tandetnik 



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] row count after a select

2008-11-05 Thread vlemaire
Hello,

Do you know a way to count the number of rows identified by a select
statement, just after the first call to sqlite3_step ? Of course without
fetching the entire result set, nor having to systematically add count(*)

Thanks !

Vincent


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] LIKE operator to support GREEK

2008-11-05 Thread Gerasimos Xydas
Hello,

I have built an SQLite 3 database from C code.

CASE 1

I tried some sql inserts from my application, in ASCII (Greek codepage).

1. I can "select * from tbl where name='GREEK_NAME';"
2. I can NOT "select * from tbl where name like '%GREEK_CHARACTERS%';" - 
I am getting no results.

CASE 2

I tried some sql inserts from my application, in UTF-8.

1. I can "select * from tbl where name='GREEK_NAME_IN_UTF8';"
2. I can NOT "select * from tbl where name like 
'%GREEK_CHARACTERS_IN_UTF8%';" -  I am getting no results.

- Is this has to do with using the ICU code?
- Is there any example how to do that?
- Any other ideas?

Best regards,
Gerasimos

-- 
Gerasimos Xydas
PhD in Informatics and Telecommunications

University of Athens
Division of Signal Processing and Telecommunications
tel: +30 210 7275320
http://www.di.uoa.gr/~gxydas
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Slow INSERT on fast machine, fast INSERT on slow machine

2008-11-05 Thread Darko Filipovic
I found that win function FlushFileBuffers (used by SQLite) slows down 
performances, 
but still don't have explanation why this funcion on some machines works 10x 
slower then on others. 

I have used win xp sp2 on all machines where I have tested the behaviour.





From: Sherief N. Farouk <[EMAIL PROTECTED]>
To: General Discussion of SQLite Database 
Sent: Tuesday, November 4, 2008 5:53:16 PM
Subject: Re: [sqlite] Slow INSERT on fast machine, fast INSERT on slow machine

> The problem is that I'm getting better performance on AMD machine with
> ATA disk,
> but 10 times slower on DualCore machine with SATA disk (both disks are
> at 7200 rpm)...
> I don't understand the source of this behaviour...

OS? Tried VSTS profiler, VTune or the free CodeAnalyst to look at where the
time is being spent?

- Sherief

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



  
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3 hangs

2008-11-05 Thread Konrad J Hambrick

On 11/05/2008 03:35 AM, Roger Binns wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Michael Muratet wrote:
>>> I guess I'm not making my myself clear. I only have one installed  
>>> version.
> 
> That is not true.  If it was true then you wouldn't have ended up with
> 3.3.6 being reported as a version in places!  You may think you only
> have one version, but the operating system obviously has more.

mm --

FWIW, RHEL includes sqlite3 version 3.3.6 as
/usr/bin/sqlite3 and the libraries for the same
are in /usr/lib/

ls -la /usr/lib/*sqlite*

lrwxrwxrwx  1 root root 19 May 18  2007 /usr/lib/libsqlite3.so.0 -> 
libsqlite3.so.0.8.6
-rwxr-xr-x  1 root root 342168 May  5  2007 /usr/lib/libsqlite3.so.0.8.6

I believe yum is linked to sqlite3 on RHEL ...

HTH.

-- kjh


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] No module named sqlite3

2008-11-05 Thread Mohammad . Kashif
Thanks for help, But I could not get the point, should I again rebuild the
python, as this time it will build sqlite3 module also because now SQlite
is already present on the system.
Is there any other way by which I can manually load the required module.
Regards
 -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> [EMAIL PROTECTED] wrote:
>> unable to import Sqlite API:  No module named sqlite3
>
> You are missing the module that binds Python to SQLite.  It comes as
> standard with Python but is only built if SQLite is already on the
> machine.  Chances are you can find it as another package to install.
> The underlying module is provided by pysqlite.
>
> Roger
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkkQ0aMACgkQmOOfHg372QTYaQCgzIulbPh3CqYGMpy9LPAFjQ9u
> 7tQAnis4fHgos9Mb+Qocq3S8sV1807gB
> =Dfg/
> -END PGP SIGNATURE-
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3 hangs

2008-11-05 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Michael Muratet wrote:
>> I guess I'm not making my myself clear. I only have one installed  
>> version.

That is not true.  If it was true then you wouldn't have ended up with
3.3.6 being reported as a version in places!  You may think you only
have one version, but the operating system obviously has more.

>> Does the version info come from a library somewhere or does it come  
>> from the executable?

When using the shell, the version information comes from the api call
sqlite3_libversion() which comes from the library.  ie if you are
dynamic linking then it comes from the dynamic library.

You can use strace to find out what exactly is going on as the process
starts.  It is best to send output to a file.  eg

  strace -o /tmp/log /usr/local/bin/sqlite3

>> Are there file permissions incorporated into a library somewhere or do  
>> they come from the executable?

IIRC they have changed over time.  In the olden days you would mark the
shared library readable and executable.  Nowadays it looks like all you
need is readable.

BTW if all you are trying to do is use SQLite with Python then you can
bypass all this malarkey and get the Python bindings to use the
amalgamation directly.  Both APSW and pysqlite can automatically
download and use it!

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkkRaPQACgkQmOOfHg372QQyxgCgo1ZlwQ2/KoAU/aKavs7/Rt/l
j8EAn0AX5qL1FDDkyPh1N8yQ7jB69x3k
=fhl5
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3 hangs

2008-11-05 Thread Michael Muratet

On Nov 4, 2008, at 5:21 PM, Roger Binns wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Michael Muratet wrote:
>> I built sqlite
>> from the aggregate code but my python project hangs.
>
> There is a specific mailing list for Python with SQLite - see
> http://itsystementwicklung.de/cgi-bin/mailman/listinfo/list-pysqlite

Thanks, I'll check it out
>
>
>> So, I tried to
>> use it from the command line and noticed that the version was 3.3.6.
>
> Since you have multiple versions of SQLite on your system and are  
> using
> it from multiple places (python module, command line shell) you need  
> to
> ensure you are picking up the right thing.

I guess I'm not making my myself clear. I only have one installed  
version. Here's what I did:

* make sure all pysqlite bits are deleted (the bits I know about,  
anyway)
* get the aggregate code from the website
* do a make distclean and make sure the binary is deleted from /usr/ 
local/bin
* do a fresh build, ./configure -> make -> make install in sqlite3.6.4
* new sqlite3 binary now in /usr/local/bin reports that it is 3.3.6
* new sqlite3 binary in the build directory reports that it is 3.6.4

>  This will depend on the
> configuration of your specific machine and includes things like  
> library
> paths hard linked into modules, $LD_LIBRARY_PATH, /etc/ld.so.conf etc.

Does the version info come from a library somewhere or does it come  
from the executable?

Are there file permissions incorporated into a library somewhere or do  
they come from the executable?

Thanks

Mike
>
>
> Roger
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkkQ2QAACgkQmOOfHg372QSyaACfacT0EfJi9tUDveacErfcRE4y
> y/UAoOBklKXBu65ZR3Eu+mKIuLl+L6Kh
> =caaA
> -END PGP SIGNATURE-
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users