Re: [sqlite] Cannot load SQLite.Interop.dll but file is in the folder

2011-05-29 Thread Black, Michael (IS)
Welcome to DLL hell...Microsoft keeps changing it... http://msdn.microsoft.com/en-us/library/ms682586(v=vs.85).aspx Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-us

Re: [sqlite] Cannot load SQLite.Interop.dll but file is in the folder

2011-05-31 Thread Black, Michael (IS)
is in the same folder as the EXE file. I do not know if there is a link but the user who experiences this problem is running my application under WIndows 7 32bit. Is there any possible link? Thanks again Cyrille Le 29/05/2011 20:33, Black, Michael (IS) a écrit : > Welcome to DLL hell...Microsoft

Re: [sqlite] Do I need to migrate to MySQL?

2011-06-03 Thread Black, Michael (IS)
My radar says having a TEXT field as a primary key is bad (your userTable). String compares are horrendously slow. Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-user

Re: [sqlite] Do I need to migrate to MySQL?

2011-06-03 Thread Black, Michael (IS)
And do you wrap all your updates inside a transaction? Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Ian Hardingham [i...@omrot

Re: [sqlite] Do I need to migrate to MySQL?

2011-06-03 Thread Black, Michael (IS)
return 0; } return 0; } On 03/06/2011 15:28, Black, Michael (IS) wrote: > > And do you wrap all your updates inside a transaction? > > Michael D. Black > >

Re: [sqlite] Do I need to migrate to MySQL?

2011-06-03 Thread Black, Michael (IS)
ResultSet; } else { // error occured Con::executef(this, 2, "onQueryFailed", m_szErrorString); delete pResultSet; return 0; } return 0; } On 03/06/2011 15:28, Black, Michael (IS) wrote: > > And do you wrap all your updates insid

Re: [sqlite] Handling of IEEE-754 nan and +/-inf in SQLite?

2011-06-06 Thread Black, Michael (IS)
That's the nice thing about standards...there's so many to choose from... :-) Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Simon

Re: [sqlite] To index or not to index?

2011-06-13 Thread Black, Michael (IS)
Ummm...wouldn't it be a whole lot simpler and faster to have an "Online" table? One id is all that's needed unless you want other info. Then you're just inserting and deleting records and the whole table is "online" at any moment. I don't see any reason why this online status needs to be smashe

Re: [sqlite] A simple SELECT

2011-06-13 Thread Black, Michael (IS)
You do this: INVOKE sqlite3_prepare_v2,__hSql,__lpszQuery,-1,eax,edx Then this: INVOKE sqlite3_step,_lpSQLStatment You probably want INVOKE sqlite3_prepare_v2,__hSql,__lpSQLStatement,-1,eax,edx At least from what I tell of your logic. You're not using the same variable fo the statement han

Re: [sqlite] A simple SELECT

2011-06-13 Thread Black, Michael (IS)
Oops...sorry...you're correct...been far too long since I've done assembler. Are we to understand that if you simply give this table a different name it works? That seems to be what you said in your initial email. Are you inserting records in the table in your assembler too? Are you abso

Re: [sqlite] EXT :Re: A simple SELECT

2011-06-13 Thread Black, Michael (IS)
...@phrio.biz] Sent: Monday, June 13, 2011 12:08 PM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] A simple SELECT If I change the table name it works. I tryed the same query using SqLite3Explorer and it does not give any result ! -Message d'origine- From: Black, Michae

Re: [sqlite] A simple SELECT

2011-06-13 Thread Black, Michael (IS)
) [m...@phrio.biz] Sent: Monday, June 13, 2011 12:45 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] EXT :Re: A simple SELECT For example "Test" -Message d'origine----- From: Black, Michael (IS) Sent: Monday, June 13, 2011 7:30 PM To: General Discussion of

Re: [sqlite] need help with a query using datetime

2011-06-17 Thread Black, Michael (IS)
sqlite> create table t(d date); sqlite> insert into t values('2011-12-31 09:00'); sqlite> insert into t values('2011-12-31 12:15'); sqlite> select d,substr(datetime(d,'-12 hours'),1,16) from t; 2011-12-31 09:00|2011-12-30 21:00 2011-12-31 12:15|2011-12-31 00:15 Michael D. Black Senior Scientist

Re: [sqlite] Critical issue

2011-06-18 Thread Black, Michael (IS)
See if this thread helps you -- a couple of different solutions. Both of which you should be able to solve for your users. http://forums.asp.net/t/939729.aspx/1 Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate Fro

Re: [sqlite] Critical issue

2011-06-18 Thread Black, Michael (IS)
Also...try dependency walker to ensure you have all the DLLs you need deployed with your package that aren't "standard". http://www.dependencywalker.com/ Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlit

Re: [sqlite] Critical issue

2011-06-19 Thread Black, Michael (IS)
ve to copy it in my application folder. Right? Sorry if my questions are stupid but I cannot figure it out. Best regards, Cyrille Le 18/06/2011 15:50, Black, Michael (IS) a écrit : > Also...try dependency walker to ensure you have all the DLLs you need deployed with your package that aren't &qu

Re: [sqlite] Help sqlite database corruption

2011-06-21 Thread Black, Michael (IS)
As I said before...welcome to DLL hell... You guessed itthe original DLL will give an error if any of the DLLs it depends on are not loadable. Since sqlite.interop.dll is non-standard you should include ALL DLLs that it depends on in your installation. Subject to Microsoft's restrictio

Re: [sqlite] Howto...multi-sqlite command string through sqlite3_prepare_v2() to create SINGLE statement

2011-06-21 Thread Black, Michael (IS)
I believe this will work if you put the SQL-required semi-colons at the end of your statements. sql = "BEGIN;"; //you need to add newline here sql += "create table episodes (id integer primary key, season int, name text);"; sql += "insert into episodes(id, season, name) Values(1,2,'bill');";

Re: [sqlite] Query with UNION on large table

2011-06-23 Thread Black, Michael (IS)
Any reason you can't add another field to your database? 0=equal 1=n1n2 The create an index on that field. Then your query plan would look like this: sqlite> explain query plan select n1,n2 from table2 where flag = 1 intersect select n2,n1 from table2 where flag = 2; sele order

Re: [sqlite] Query with UNION on large table

2011-06-23 Thread Black, Michael (IS)
qlite.org [sqlite-users-boun...@sqlite.org] on behalf of Black, Michael (IS) [michael.bla...@ngc.com] Sent: Thursday, June 23, 2011 2:03 PM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] Query with UNION on large table Any reason you can't add another field to your datab

Re: [sqlite] question about sqlite aggregate funcitons

2011-06-25 Thread Black, Michael (IS)
Ucaching? Try doing your first select last and see what happens. I'm betting your first "select min(*) from test" will be a lot slower. Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-b

Re: [sqlite] question about sqlite aggregate funcitons

2011-06-25 Thread Black, Michael (IS)
ior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Luuk [luu...@gmail.com] Sent: Saturday, June 25, 2011 7:37 AM To: sqlite-users@sqlite.org Subject: EXT :Re

Re: [sqlite] question about sqlite aggregate funcitons

2011-06-25 Thread Black, Michael (IS)
s-boun...@sqlite.org] on behalf of Black, Michael (IS) [michael.bla...@ngc.com] Sent: Saturday, June 25, 2011 8:15 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] question about sqlite aggregate funcitons OK...I generated 10M ints and imported them. I get times that I would

Re: [sqlite] question about sqlite aggregate funcitons

2011-06-25 Thread Black, Michael (IS)
Can the optimizer recognize these "instant" functions and perhaps lean towards using them? Are there cases where this would NOT be good? I did show you can construct a query which runs at the "correct" speed. sqlite> select * from (select min(i) from test) as a,(select max(i) from test) as

Re: [sqlite] EXT :Re: question about sqlite aggregate funcitons

2011-06-25 Thread Black, Michael (IS)
Simon Slavin [slav...@bigfraud.org] Sent: Saturday, June 25, 2011 10:38 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] question about sqlite aggregate funcitons On 25 Jun 2011, at 4:12pm, Black, Michael (IS) wrote: > Can the optimizer recognize these "instant&q

Re: [sqlite] Substring question

2011-06-26 Thread Black, Michael (IS)
It's not obvious but this works CREATE TABLE x (s string); INSERT INTO "x" VALUES('ab:cdef'); INSERT INTO "x" VALUES('ghij:klmn'); sqlite> select ltrim(ltrim(s,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'),':') from x; ltri cdef klmn Just make sure your char set contains all po

Re: [sqlite] Compile sqlite3 with g++? Do I need a wrapper?

2011-06-28 Thread Black, Michael (IS)
I'd recommend NOT relying on the system sqlite3. That way you can control your changes. Get the amalgamation and put sqlite3.c and sqlite3.h in your project. And, you forgot to put in the name for "-o" -- so you would get a file named "-lsqlite3" in your directory. And you'll probably n

Re: [sqlite] Is this a BUG or am I wrong ? sub-select returns nothing when column id matches the inner query

2011-06-28 Thread Black, Michael (IS)
Use single quotes instead of double sqlite> select (select v from t1 where n='a') wrong,* from a1; wrong|a|b 2000|123|456 2000|999|999 Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sql

Re: [sqlite] Defining a relationship as unique

2011-06-30 Thread Black, Michael (IS)
You're getting closeif you don't use a field in a table you don't HAVE to create it. Also...if you want to make your database a bit more bullet proof you want foreign keys to help ensure you maintain the relationship between users and tournaments (otherwise you can accidentally delete somet

Re: [sqlite] Defining a relationship as unique

2011-06-30 Thread Black, Michael (IS)
ct: EXT :Re: [sqlite] Defining a relationship as unique On 06/30/11 02:31 PM, Black, Michael (IS) wrote: > sqlite> create table user(userid integer primary key autoincrement,name > varchar, login varchar); > sqlite> create unique index index1 on user(userid); Isn't userid alrea

Re: [sqlite] How to search for multiple values in a column including null without repeating column name ?

2011-07-02 Thread Black, Michael (IS)
If you can build your SQL string with column_name exactly what is the problem with adding it a 2nd time? How do you build your SQL statement? And I get the same answer with either of your queries in 3.7.4 -- what version are you running and what answer are you getting? Are you saying that

Re: [sqlite] How to search for multiple values in a column including null without repeating column name ?

2011-07-02 Thread Black, Michael (IS)
That would 'splain it...I should have noticed... So we're left with this question... What's the problem with building the query that works? I don't see where you can't make it "column agnostic"...though perhaps there's another definition of that sprintf(sql,"select * from t where %s i

Re: [sqlite] Insert not working for sqlite3

2011-07-07 Thread Black, Michael (IS)
You're going to have to create a complete stand-alone example if you want us to debug your code for you. Make a simple program that only does that one insert and share that with us. Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate

Re: [sqlite] SQLite Encryption Extension (SEE) and Public Domain Sqlite

2011-07-07 Thread Black, Michael (IS)
If you hash the username too you don't have that problem. Passwords should always be a 1-way hash. It's actually best to collapse username/password into a single one-way hash. That way it's very difficult to crack it. You can use a user "account#" value that users would have to track for suppor

Re: [sqlite] Insert not working for sqlite3

2011-07-08 Thread Black, Michael (IS)
I downloaded 5.3.6 from here -- I used the Thread Safe version Installer. http://windows.php.net/download/ And you're script ran just fine and created this: sqlite> .dump PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE tbl2 (one varchar(10),two varchar(10)); COMMIT; I the modified

Re: [sqlite] using index when using concatination

2011-07-10 Thread Black, Michael (IS)
Any particular reason you can't build your own string and just pass one parameter? select * from words where "word" like ?; And any reason why you don't create a 2nd field holds the 1st and last char? and index that? Then your query should be blazingly fast as it will actually use the index

Re: [sqlite] using index when using concatination

2011-07-10 Thread Black, Michael (IS)
3.7.4 doesn't indicate it will use an index in either case with like...but glob seems to call the index...why does glob use the index but like does not? sqlite> create table words(word text); sqlite> create index idx on words(word); sqlite> explain query plan select * from words where "word"

Re: [sqlite] using index when using concatination

2011-07-10 Thread Black, Michael (IS)
words where word glob 'L*P'; 136 CPU Time: user 0.015625 sys 0.00 sqlite> select count(*) from words where word like 'L%P'; 136 CPU Time: user 0.281250 sys 0.00 Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate ___

Re: [sqlite] Storing/editing hierarchical data sets

2011-07-10 Thread Black, Michael (IS)
Somebody smarter than I may be able to figure out how to use views to do the upper levels. But if you can afford your database to be a bit less then twice as big just use tables. create table level1(id int,l int,r int); insert into level1 values(1,251,18); insert into level1 values(2,5,91); i

Re: [sqlite] Insert not working for sqlite3

2011-07-11 Thread Black, Michael (IS)
If CREATE has no return why do I get a return? To be clear I'm using PHP 5.3.6 and it most definitely gets a return But I re-wrote this according to some PDO examples I found. This is a more complete example. You should be able to run this with a PHP command line -- forget the web interfa

Re: [sqlite] Storing/editing hierarchical data sets

2011-07-11 Thread Black, Michael (IS)
I can see adding a forward/reverse link to the tables making it a linked-list type structure much like your btree. By default each node is linked to the one in front and back. Then you adjust those pointers for cut/paste operations. You could also do the cut/paste just by copying to a new tabl

Re: [sqlite] Storing/editing hierarchical data sets

2011-07-12 Thread Black, Michael (IS)
I thought of another way to do your copy/cut/paste... Assuming you keep the original audio around and use the levels I showed before. create table sequence(level int,parent int,start int,end end); insert into seqeunce values(1,0,0,-1); // note that -1 means "until end of data". See where

Re: [sqlite] Minimize sqlite3.o size

2011-07-12 Thread Black, Michael (IS)
http://www.sqlite.org/compile.html Read section 1.4 -- tells you all you need to know. First thing you should do is see if there's any significant performance difference with -Os instead of -O3. You may be surprised. Michael D. Black Senior Scientist NG Information Systems Advanced

Re: [sqlite] Index question about index

2011-07-14 Thread Black, Michael (IS)
Would glob be faster than like? Since I assume like has to case-convert? And you don't have to set any pragmas or NOCASE for it to use the index. select * from tsamov where tsamov_code glob 'AFG*'; sqlite> explain query plan select * from tsamov where tsamov_code glob 'AFG*'; sele order

Re: [sqlite] Hidding records from the application

2011-07-16 Thread Black, Michael (IS)
If each pid sees a completely separate set of rows then add the pid to each row and select by pid. If 2 pid's can see any of the same records this won't work (i.e. all pid's must be mutually exclusive) No views necessary but you could create a view for each pid if you wanted to for some re

Re: [sqlite] year, month & day problem

2011-07-17 Thread Black, Michael (IS)
Column numbers are zero-based, not one-based. >From http://www.sqlite.org/c3ref/column_blob.html "The leftmost column of the result set has the index 0. " That's at least part of your problem. So should be: k.AAArticoli=sqlite3_column_int(statmentS, 0); k.MMArticoli

Re: [sqlite] Hidding records from the application

2011-07-17 Thread Black, Michael (IS)
If you don't know how to get your rules yet then you don't know how to design a solution. Based on what you've said I see 2 more tables. create table (pid int, rule int) create table (rule int, record int) You can have multiple rules per pid, reuse rules across pids, and records can overl

Re: [sqlite] Hidding records from the application

2011-07-17 Thread Black, Michael (IS)
I decided to test this so here's an almost-complete example minus any cross-checks on the tables which you should ultimately do. This implements exclusion rules which is what you've been describing. You can make them inclusion rules if you just remove the "not" in the select statement below, but

Re: [sqlite] Handle leak using IIS on windows 7?

2011-07-18 Thread Black, Michael (IS)
If you showed a small sample code that caused your problem it would sure help a lot. I peeked at the library code. That message is generated when _cnn is null (the DB connection). private void InitializeForReader() { if (_activeReader != null && _activeReader.IsAlive) t

Re: [sqlite] Performance Improvement

2011-07-18 Thread Black, Michael (IS)
Unless your caching at byte-level you don't need all the addresses. For 4K page size mask off the lower 11 bits. You should actually be able to reduce your memory usage by a LOT if you track by pages and not bytes. That will also speed you up along with it. Michael D. Black Senior Sci

Re: [sqlite] Performance Improvement

2011-07-21 Thread Black, Michael (IS)
Could you define "awfully slow"? That's pretty hard to tell if your speed is what one should expect. Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Paul Linehan [lin

Re: [sqlite] Select names where occurences are greater than 10

2011-07-21 Thread Black, Michael (IS)
select id,count(distinct track) from tracks group by id having count(distinct track)>=10; Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on be

Re: [sqlite] SELECT query first run is VERY slow

2011-07-22 Thread Black, Michael (IS)
You need to normalize your database. Though it's easy to put everything in one table it's horrendously inefficient for indexing. Your indexes are huge as you're putting strings in them. Ideally you should never have a string in an index if you can avoid it. Too much space, too long a time

Re: [sqlite] Strange result using JOIN

2011-07-22 Thread Black, Michael (IS)
Try "order by code.rowid" I think that will do what you want and fits in with what sqlite3's behavior should be. As long as you don't delete rows you'll be OK. http://www.sqlite.org/autoinc.html Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From:

Re: [sqlite] System.Data.Sqlite problem

2011-07-22 Thread Black, Michael (IS)
And don't you wish Microsoft and other's could spit out intelligent error messages like: "64-bit application trying to load 32-bit DLL". I ding my students whey do stupid stuff like: FILE *fp=fopen(filename,"r"); if (fp == NULL) { fprintf(stderr,"Cannot open file\n"); } Instead of

Re: [sqlite] EXT :Re: SELECT query first run is VERY slow

2011-07-25 Thread Black, Michael (IS)
An 8X speedup is a pretty good achievement...congrats... #1 I take it your query is CPU bound the first time? #2 Can you show us the query planner please? #3 Can you show us the query planner minus the "INDEXED BY"? #4 Can you show us sqlite_stat1? #5 Can you show us your tables now? #6 Wha

Re: [sqlite] SELECT query first run is VERY slow

2011-07-25 Thread Black, Michael (IS)
You need to normalize your "kind" value. .pragma cache_size=15000; drop index idxlog_kind_computer; create table kind(id integer,kind text); insert into kind values(1,'debug'); insert into kind values(2,'error'); insert into kind values(3,'info'); insert into kind values(4,'timing'); insert in

Re: [sqlite] SELECT query first run is VERY slow

2011-07-26 Thread Black, Michael (IS)
That's because they have 2 completely different query plans. I created the table so that id,a,b,c all had the same values so the indexing would be indentical. #include main() { int i; for(i=1;i<=10;++i) { char sql[4096]; sprintf(sql,"insert into abctable(a,b,c) values(%d,%d,%d

Re: [sqlite] SELECT query first run is VERY slow

2011-07-26 Thread Black, Michael (IS)
If I run your sql.txt script with the normalization of kind my first time query shows 0 seconds. D:\x>sqlite3 sq1 > select count(*) as cnt,kind,computer > from log > group by kind,computer > order by cnt desc > > what happens here? > > SELECT * > FROM log INDEXED BY idxlog_kind_computer > WHER

Re: [sqlite] SELECT query first run is VERY slow

2011-07-26 Thread Black, Michael (IS)
Part of the problem is it seems you can't create an index with rowid: 3.7.5 sqlite> create table t(i int); sqlite> create index idx1 on t(i); sqlite> create index idx2 on t(i,rowid); Error: table t has no column named rowid Any particular reason it can't be included in an index? Michael

Re: [sqlite] LevelDB benchmark

2011-07-29 Thread Black, Michael (IS)
What they don't say explicitly is that if all you need is key/value capability then an SQL database is overkill and only slows you down (bit of a duh factor there though not obvious to neophytes). Generally speaking that's one thing they don't teach in college is optimization. I can't count th

Re: [sqlite] LevelDB benchmark

2011-07-29 Thread Black, Michael (IS)
se Subject: EXT :Re: [sqlite] LevelDB benchmark 2011/7/29 Black, Michael (IS) : > What they don't say explicitly is that if all you need is key/value > capability then an SQL database is overkill and only slows you down (bit of a > duh factor there though not obvious to neophytes).

Re: [sqlite] LevelDB benchmark

2011-07-30 Thread Black, Michael (IS)
I ran a few tests. First the 2 tests from Rev 45. Then NORMAL sync, and finally bump the cache up to what sqlite3 needs vs an arbitrary 100M. I think the question should be how well does it perform in cache -- not necessarily how much cache it needs. How much cache is just a comparision of m

Re: [sqlite] Will SQLite supports UnQL?

2011-08-01 Thread Black, Michael (IS)
This is a side-question to this thread...but has anybody every done row-level locking for edit? I can see it: create table t(id int primary key,stuff text, lock l); insert into t values(1,'stuff1',0); select * from t where id=1 and lock=0; // or drop lock to get all and check lock!=0 to make

Re: [sqlite] Virtual Table xBestIndex and NULL Search Conditions (Bug?)

2011-08-01 Thread Black, Michael (IS)
If it's meaningless then shouldn't it be a syntax error? Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Simon Slavin [slav...@bi

Re: [sqlite] Field drop work around

2011-08-02 Thread Black, Michael (IS)
Since SQLite is type agnostic why don't you use generic field names? Just name your fields 0-NN and keep a set of defines for field names. Then you just use #define to name the fields. create table mytable (field1,field2,field3,field4); #define NAME "field1" #define ADDR "field2" #def

Re: [sqlite] Threading makes SQLite 3x slower??

2011-08-04 Thread Black, Michael (IS)
You didn't show your timing results or say what kind of machine you're running on. I'm also seeing Calculating Subset Sample... SQL error (635): near "ORDER": syntax error I'm running Linux, sqlite 3.7.5, E5520 2.27Ghz Intel with 16 threads possible. Here's my timings just on the first few rows

Re: [sqlite] Threading makes SQLite 3x slower??

2011-08-04 Thread Black, Michael (IS)
Also.. . Your elapsed time is using clock() which tells you processor time. With SQLITE_THREADSAFE=2 59.855 - 1 thread 49.535 - 2 threads 92.789 - 3 threads with SQLITE_THREADSAFE=1 61.146 - 1 thread 49.568 - 2 threads 64.932 - 3 threads The way you're splitting your work is bad.

Re: [sqlite] Maximum number of tables in a data file

2011-08-09 Thread Black, Michael (IS)
Sounds to me like you're over normalizing things. You'll never want to do a query spanning multiple minutes in your described setup? http://www.sqlite.org/limits.html The main limit that applies to your question is max of 64 tables in a Join. But you apparently never plan on joining t

Re: [sqlite] Maximum number of tables in a data file

2011-08-09 Thread Black, Michael (IS)
MongoDB http://www.mondodb.org Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Jaco Breitenbach [jjbrei

Re: [sqlite] Shell doesn't do

2011-08-10 Thread Black, Michael (IS)
If you want it just DIY... .mode html select ""; select * from stuff; select ""; Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on be

Re: [sqlite] Shell doesn't do

2011-08-10 Thread Black, Michael (IS)
If you don't like upper case then change the code and re-compile. That's the nice part of source code. Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sq

Re: [sqlite] In memory v/s tmpfs

2011-08-10 Thread Black, Michael (IS)
Under Linux: man fuser Will detect other processes which have the DB open. It's done by looking at all the /proc entries. Under windows http://www.codeproject.com/KB/IP/OpenFiles.aspx Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users

Re: [sqlite] SQLite with 10M record

2011-08-11 Thread Black, Michael (IS)
Have you ever used SQLite before? 10M records is not a big deal. With experience it should take you less than hour to prove this one way or the other. But that depends on you having experience with databases (indexes) and SQLite in particular (WAL mode, exclusive locking, etc). Without expe

Re: [sqlite] SQLite with 10M record

2011-08-11 Thread Black, Michael (IS)
nize application data better. With Regards, Sumit Gupta -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Black, Michael (IS) Sent: 11 August 2011 17:54 To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite with 10M r

Re: [sqlite] Bulk Insert

2011-08-12 Thread Black, Michael (IS)
It doesn't hold them in memory...they are still written to disk and just rolled back if you abort the transaction. Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users

Re: [sqlite] Bulk Insert

2011-08-12 Thread Black, Michael (IS)
ansaction only. Any guidance is great. Looks like Sqlite finally solve my problem thus far :). With Regards, Sumit Gupta -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Black, Michael (IS) Sent: 12 August 2011 17:48 To: General

Re: [sqlite] Insert rows into a foreign key table

2011-08-15 Thread Black, Michael (IS)
insert into orders (OrderNo,P_Id) select 12345,P_Id from persons where LastName='Hansen'; Should do it for you. Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-b

Re: [sqlite] Insert rows into a foreign key table

2011-08-15 Thread Black, Michael (IS)
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Igor Tandetnik [itandet...@mvps.org] Sent: Monday, August 15, 2011 6:58 AM To: sqlite-users@sqlite.org Subject: EXT :Re: [sqlite] Insert rows into a foreign key table Black, Michael (IS) wrote: > insert i

Re: [sqlite] Improving the query optimizer

2011-08-18 Thread Black, Michael (IS)
Run "analyze" and your numbers will make more sense...albeit still not perfect. Those numbers are estimations, ergo the "~" in the answer. Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@s

Re: [sqlite] Difference between Setups and Precompiled binaries for windows

2011-08-18 Thread Black, Michael (IS)
I think if you check the archives everybody has come to the conclusion that just putting the amalgamation in your project is your best solution and build it yourself. Then you never have to worry about somebody blowing away the DLL. You don't save anything using the DLL unless your planning on

Re: [sqlite] Last record in db

2011-08-22 Thread Black, Michael (IS)
Oh...can I guess? select * from table where rowid=max(rowid); Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of sreekumar...

Re: [sqlite] Last record in db

2011-08-22 Thread Black, Michael (IS)
Or if you are talking about some specific select statement. select * from table order by mystuff desc; Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@s

Re: [sqlite] EXT :Re: Last record in db

2011-08-22 Thread Black, Michael (IS)
No...if you use autoincrement you can guarantee that "last" will be the last record inserted. So "select * from mytable where myid=max(myid)" will work where myid is autoincrement. The normal rowid will work also as long as you don't delete the max(rowid) and you don't insert more than 9,2

Re: [sqlite] EXT :Re: Last record in db

2011-08-22 Thread Black, Michael (IS)
What happens when you do: select * from t1 where rowid = (select max( rowid ) from t1); or select * from t1 where rowid in (select max( rowid ) from t1); On Mon, Aug 22, 2011 at 10:01 AM, Cousin Stanley wrote: > > Black, Michael (IS) wrote: > >> select * from table where row

Re: [sqlite] Last record in db

2011-08-22 Thread Black, Michael (IS)
sqlite3 does NOT guarantee rowid always increments and never gives FULL return (at least according to the docs). autoincrement does. http://www.sqlite.org/autoinc.html Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate _

Re: [sqlite] Last record in db

2011-08-22 Thread Black, Michael (IS)
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Simon Slavin [slav...@bigfraud.org] Sent: Monday, August 22, 2011 11:32 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] EXT :Re: Last record in db On 22 Aug 2011, at 5:13pm, Igor Tandetnik wrote

Re: [sqlite] Last record in db

2011-08-22 Thread Black, Michael (IS)
NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Igor Tandetnik [itandet...@mvps.org] Sent: Monday, August 22, 2011 11:49 AM To: sqlite-users@sqlite.org Subject: EXT :Re: [sqlite]

Re: [sqlite] Last record in db

2011-08-22 Thread Black, Michael (IS)
andet...@mvps.org] Sent: Monday, August 22, 2011 12:18 PM To: sqlite-users@sqlite.org Subject: EXT :Re: [sqlite] Last record in db On 8/22/2011 1:11 PM, Black, Michael (IS) wrote: > Sure it does. > > sqlite> select rowid,id,* from t1 where id=(select max(id) from t1); > 4|4|4|two &

Re: [sqlite] Last record in db

2011-08-22 Thread Black, Michael (IS)
..@sqlite.org] on behalf of Igor Tandetnik [itandet...@mvps.org] Sent: Monday, August 22, 2011 12:44 PM To: sqlite-users@sqlite.org Subject: EXT :Re: [sqlite] Last record in db On 8/22/2011 1:33 PM, Black, Michael (IS) wrote: > That's because my id is autoincrement and yours is not. W

Re: [sqlite] Last record in db

2011-08-22 Thread Black, Michael (IS)
nformation Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Igor Tandetnik [itandet...@mvps.org] Sent: Monday, August 22, 2011 1:14 PM To: sqlite-users@sqlite.org Subject: EXT :Re: [sqlite] Last record in d

Re: [sqlite] Last record in db

2011-08-22 Thread Black, Michael (IS)
:Re: [sqlite] Last record in db On 22 Aug 2011, at 8:43pm, Black, Michael (IS) wrote: > I thought we were answering the question "how can I retrive the last row" -- > though we never got a definition of what "last" meant. [snip] which is, of course, the problem with t

Re: [sqlite] Last record in db

2011-08-22 Thread Black, Michael (IS)
;;" sqlite> select id,data from t1 order by id desc limit 1; 4|two Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Igor Tandetnik [itandet...@mvps.org] Sent: Monda

Re: [sqlite] Autoincrement failure

2011-08-23 Thread Black, Michael (IS)
Give the recent notice of a bug in gcc-4.1 what compiler are you using and how are you compiling? And can you reproduce this with a small example table? Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqli

Re: [sqlite] EXT :Re: Autoincrement failure

2011-08-23 Thread Black, Michael (IS)
And at least show us the code where you're doing your insert...my money says you're doing it wrong. Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.o

Re: [sqlite] Autoincrement failure

2011-08-23 Thread Black, Michael (IS)
can I avoid this corruption? Or How can protect my DB against this kind of corruption? Thanks for any help Alessandro From: "Black, Michael (IS)" To: General Discussion of SQLite Database Date: 23/08/2011 14.10 Subject: Re: [sqlite] Autoincrement failure Give the recent notice of

Re: [sqlite] Autoincrement failure

2011-08-23 Thread Black, Michael (IS)
e TIME, Item BLOB, PRIMARY KEY(ClosureNum, TicketNum, ItemNum))" example insert (sorry for cut&paste from my code...): sprintf(zSql, "INSERT INTO Journal VALUES(%i, %i, %i, '%s', '%s', '%s')", nv.dgfe_db_pntr->triad.closure_num+1, nv.dgfe_db_pntr-

Re: [sqlite] Autoincrement failure

2011-08-23 Thread Black, Michael (IS)
Dont' know if this is related but are you keeping the database open all the time or closing and reopening? If reopening does this only occur after opening again? Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate F

Re: [sqlite] Re indexing (if such a thing exist) performance

2011-08-24 Thread Black, Michael (IS)
I'd like to hear what you're doing and why you think SQLite is the way to do it. And what are your speed requirements? You are apparently worried about speed but never tested to see if SQLite was fast enough. You could've tested it yourself in a matter of an hour or so. I imagine an update i

Re: [sqlite] Re indexing (if such a thing exist) performance

2011-08-24 Thread Black, Michael (IS)
What you're saying makes sense. But you haven't stated a problem... Are you far enough along you can show timing beween 1st and 2nd queue fills? How long does it take you to insert your first million? How long does it take you to insert your second million? Michael D. Black Senior Sci

<    2   3   4   5   6   7   8   9   >