[sqlite] sqlite3 (or sqlite4) performance on NFS

2015-04-12 Thread Howard Chu
Stephen Chrzanowski wrote:
>>From what I understand;
> - Read-Only data
> - Data doesn't change frequently
> - Central repository for data
> - Network latency causing issues
>
> My two cents on this is to keep a database revision ID kicking around and
> do a SQLite backup of the remote data to a local storage medium.  At
> application launch, check the local version of the database, then check the
> NFS version, and if there is a mismatch or a local copy doesn't exist, have
> the application ask (Or force if no local copy exists) to copy the data
> from remote to local, then read data from the local source.  This will be a
> bit of a PITA if you're talking gigabytes of storage on a saturated 100mbit
> network or if drive space is limited.  (I love my quiet GigE network)

Congratulations, you've just reinvented AFS, but without any of its 
convenience.

Seriously - there are many other distributed filesystems out there, all 
designed because users keep running into the same deficiencies of NFS, 
over and over again. Please, can we stop reinventing this wheel now?

-- 
   -- Howard Chu
   CTO, Symas Corp.   http://www.symas.com
   Director, Highland Sun http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/


[sqlite] sqlite_column_blob & invalid index

2015-04-12 Thread gwenn
Ok,
Thanks.

On Sun, Apr 12, 2015 at 2:08 PM, Stephan Beal  wrote:
> On Sun, Apr 12, 2015 at 2:04 PM, gwenn  wrote:
>
>> Thanks for reply.
>> Could you please elaborate ?
>> For me, there is no way to know if the specified column index is
>> invalid by using the column value returned by
>> sqlite3_column_blob/text/int .
>>
>
> i was mistaken: the docs say:
>
>
> "If the SQL statement does not currently point to a valid row, or if the
> column index is out of range, the result is undefined. "
>
> But you can figure out the count:
>
> http://sqlite.org/c3ref/column_count.html
>
>
> --
> - stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
> "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
> those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite_column_blob & invalid index

2015-04-12 Thread Stephan Beal
On Sun, Apr 12, 2015 at 2:04 PM, gwenn  wrote:

> Thanks for reply.
> Could you please elaborate ?
> For me, there is no way to know if the specified column index is
> invalid by using the column value returned by
> sqlite3_column_blob/text/int .
>

i was mistaken: the docs say:


"If the SQL statement does not currently point to a valid row, or if the
column index is out of range, the result is undefined. "

But you can figure out the count:

http://sqlite.org/c3ref/column_count.html


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf


[sqlite] sqlite_column_blob & invalid index

2015-04-12 Thread gwenn
Thanks for reply.
Could you please elaborate ?
For me, there is no way to know if the specified column index is
invalid by using the column value returned by
sqlite3_column_blob/text/int .
Regards.

On Sun, Apr 12, 2015 at 11:50 AM, Stephan Beal  wrote:
> On Sun, Apr 12, 2015 at 11:48 AM, gwenn  wrote:
>
>> Hello,
>> Could you please tell me if sqlite3_errcode/sqlite3_errmsg should be
>> called after each call to sqlite3_column_blob/text/int/... to check
>> that the column index is valid ?
>>
>
> Not needed - simply check the result code of your call to
> sqlite3_column_xxx(). (Users should always check the result codes of their
> sqlite3 API calls.)
>
> --
> - stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
> "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
> those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite_column_blob & invalid index

2015-04-12 Thread Stephan Beal
On Sun, Apr 12, 2015 at 11:48 AM, gwenn  wrote:

> Hello,
> Could you please tell me if sqlite3_errcode/sqlite3_errmsg should be
> called after each call to sqlite3_column_blob/text/int/... to check
> that the column index is valid ?
>

Not needed - simply check the result code of your call to
sqlite3_column_xxx(). (Users should always check the result codes of their
sqlite3 API calls.)

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf


[sqlite] sqlite_column_blob & invalid index

2015-04-12 Thread gwenn
Hello,
Could you please tell me if sqlite3_errcode/sqlite3_errmsg should be
called after each call to sqlite3_column_blob/text/int/... to check
that the column index is valid ?

I am confused by:
> http://sqlite.org/rescode.html#range
> The SQLITE_RANGE error indices that the parameter number argument to one of 
> the sqlite3_bind routines is out of range.
Here , there is no mention to sqlite3_column_blob.

> http://sqlite.org/c3ref/column_blob.html
> if the column index is out of range, the result is undefined.
Here, there is no mention to SQLITE_RANGE.

> http://www.sqlite.org/cgi/src/artifact/583d56b129dd27f1
> static Mem *columnMem(sqlite3_stmt *pStmt, int i){
> ...
>   sqlite3Error(pVm->db, SQLITE_RANGE);
> ...
> }

> http://www.sqlite.org/cgi/src/artifact/40e333960d53f7d5
> const char *sqlite3ErrStr(int rc){
> ...
>/* SQLITE_RANGE   */ "bind or column index out of range",
> ...
> }
Here, there is a mention to "column index out of range"

Regards.