Re: [sqlite] Without ROWID and Autoincrement question

2014-12-27 Thread Mohit Sindhwani
On 27/12/2014 12:13 AM, Teg wrote: Because AUTOINCREMENT keyword changes the behavior of the ROWID selection algorithm, AUTOINCREMENT is not allowed on WITHOUT ROWID tables or on any table column other than INTEGER PRIMARY KEY. Any attempt to use AUTOINCREMENT on a WITHOUT ROWID table or on a

Re: [sqlite] Partial index to find maximum

2014-12-29 Thread Mohit Sindhwani
On 29/12/2014 4:33 PM, Baruch Burstein wrote: Hi, I have a table with a 2 column PK, say 'a' and 'b'. I need to find, for a given value of 'a', the highest matching 'b'. The query itself it simple: SELECT max(b) FROM t WHERE a=:whatever To speed this up, I would add an index on 'a'. Now,

Re: [sqlite] Looking for SQLite schema doc generator (in HTML) for tables, fields, etc

2015-02-03 Thread Mohit Sindhwani
On 4/2/2015 12:20 AM, Gerald Bauer wrote: Hello, I have started two hours ago ;-) to put together a little script. The idea is to "dump" the schema as json and then use a static site generator w/ html templates to generate the docu. So far the script that generates the json dump (is

[sqlite] website documentation wording

2015-12-13 Thread Mohit Sindhwani
On 5/12/2015 2:08 AM, Keith Medcalf wrote: > Well, a Gartner Report paid for by Microsoft, which said that if you > pronounced it "ess queue ell" you were labelling yourself as a professional > programmer who understood relational database technologies, had probably used > them since the 1970's

[sqlite] Tables and Columns of Database of Whatsapp

2015-07-01 Thread Mohit Sindhwani
On 30/6/2015 11:11 PM, Stephen Chrzanowski wrote: > There are a few posts in this mailing list that have people putting up > public domain database structures, with data, for different things to > track. Google search also has come up with a few out there as well, but, > you really got to nail

[sqlite] full table scan ignores PK sort order?

2015-03-04 Thread Mohit Sindhwani
On 3/3/2015 6:59 PM, Jean-Christophe Deschamps wrote: > At 11:27 03/03/2015, you wrote: > >> - the full table scan returns rows in rowID order, which is the order >> in which the rows were added to the table > `--- > > No and no. > > An SQL engine doesn't guarantee any row "order" unless you

Re: [sqlite] Big number of tables

2013-11-29 Thread Mohit Sindhwani
Hi Carlos, On 29/11/2013 9:33 PM, Carlos Ferreira wrote: Any of you know how to speed up the creation of empty tables in SQlite? If I have to create more than 1000 empty tables to initialize my application document it takes a while.. Is there any workaround? Workaround: 1. I would probably

Re: [sqlite] Eficiency : 1 table vs several tables

2013-11-29 Thread Mohit Sindhwani
Hi Carlos, On 30/11/2013 4:27 AM, Carlos Ferreira wrote: My tables have all the same number of columns ( 1 column only.. of BLOBs.) and Simon Slavin suggested I could use only one big table where I add an extra column to identify the table name. I would consider searching by an integer ID

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Mohit Sindhwani
On 1/12/2013 12:55 AM, Eric Teutsch wrote: .Tables doesn't show the 2 new tables. A select statement on one of those tables says "No such table". And "select * from sqlite_master" shows the 8 tables and 1 trigger. And ends there. But when using sqliteodbc, I can run the select statement on a

Re: [sqlite] Does SQLIte run under Windows CE?

2013-11-30 Thread Mohit Sindhwani
On 30/11/2013 1:28 AM, J Trahair wrote: Does SQLIte run under Windows CE? And if so, which version should I download? Thank you. J Trahair Yes, we are using various versions of 3.7.xx in Windows CE 5.0 and 6.0 without any problems. Best Regards, Mohit. 1/12/2013 | 12:59 AM.

Re: [sqlite] Happy New Year

2014-01-01 Thread Mohit Sindhwani
On 1/1/2014 8:46 AM, Igor Korot wrote: Hi, ALL, I want to wish everybody who is reading and involved with the list Happy and oyful New Year! Let's have a great time in it and lets make a lot of good products and new releases with the software that everybody involve with. Thank you. Indeed!

Re: [sqlite] Proposed enhancement to the sqlite3.exe command-lineshell

2014-03-31 Thread Mohit Sindhwani
On 11/2/2014 1:57 AM, Richard Hipp wrote: On Mon, Feb 10, 2014 at 12:51 PM, wrote: I second the idea of a kind of "WARNING: All your work will be lost, are you sure you want to quit? (y/N)" on trying to exit, but *ONLY* if the application was started by (double-)clicking on it,

Re: [sqlite] Database access slowness on specific WinCE devices

2014-04-15 Thread Mohit Sindhwani
On 15/4/2014 3:36 PM, Joe Mistachkin wrote: It might be useful to measure the processor and storage performance of the device, using some external benchmarking tool, and then compare it against the other devices you have. If the disk performance is indeed slower on this particular device,

Re: [sqlite] Best compression for sqlite3 ?

2014-05-13 Thread Mohit Sindhwani
On 13/5/2014 2:45 PM, Simon Slavin wrote: There are two versions of your question: one for compression of a database which is only going to be read from now on and another for compression of a database which has to support writing. hwaci, Richard Hipp's own company, support both ZIPVFS and

[sqlite] R-Tree Storage Optimization for Points

2014-06-18 Thread Mohit Sindhwani
Hello! We are using SQLite3 for storing geographical points that can be queried using a bounding box (find everything that lies within this box). Obviously, this query fits the capabilities of the RTree module very well and it is a simple 2 dimensional search using an R-Tree that has 5

Re: [sqlite] R-Tree Storage Optimization for Points

2014-06-19 Thread Mohit Sindhwani
Hi Noël, Thanks for our reply. On 19/6/2014 2:19 PM, Noel Frankinet wrote: Hi Mohit, Maybe you should use the spatialite extension ? Noël I have to see if indeed spatialite handles the data more efficiently since it also relies on the R-Tree for quite a bit of stuff. That said, I do

Re: [sqlite] R-Tree Storage Optimization for Points

2014-06-19 Thread Mohit Sindhwani
Hi Wolfgang, On 19/6/2014 11:54 PM, Wolfgang Enzinger wrote: Not sure why you think you have to store those point coordinates twice. This works: sqlite> CREATE VIRTUAL TABLE abc USING rtree(id,x,y); sqlite> INSERT INTO abc VALUES(1,20,30); sqlite> SELECT id FROM abc WHERE x>=10 AND x<=30 AND

Re: [sqlite] R-Tree Storage Optimization for Points

2014-06-20 Thread Mohit Sindhwani
Hello All... On 20/6/2014 3:01 AM, Wolfgang Enzinger wrote: I stand corrected. Should have tried this before: sqlite> INSERT INTO abc VALUES(2,30,20); Error: constraint failed Note to self: r-tree is about *ranges* in 1 to 5 dimensions. Coming back to the original problem again... I was

Re: [sqlite] R-Tree Storage Optimization for Points

2014-06-20 Thread Mohit Sindhwani
On 20/6/2014 8:08 PM, Clemens Ladisch wrote: Not without changing the SQLite code. A non-leaf R-tree node must store the extents covered by all its children, so these are (n-dimensional) rectangles. At the moment, SQLite assumes that user data has exactly the same format, so such a change

Re: [sqlite] CRUD Statistics

2014-07-08 Thread Mohit Sindhwani
Hi Sandu, On 8/7/2014 2:46 PM, Sandu Buraga wrote: Is there a possibility to extract a statistic of how many CRUD operations do I have during an application life-cycle? I would like to find-out how many INSERTs do I have, how many SELECTs and so on. My guess is that the best way would be by

[sqlite] Selecting indexes to use & NOT INDEXED

2011-06-27 Thread Mohit Sindhwani
Hi All, Sorry for the long email, but the background is probably needed :) 1. We have a geographical query that is supported by an R-Tree index. A join is required to filter by category while restricting by the bounding box. On the main table (objects), we have an index IDX_OBJ_CAT on

Re: [sqlite] Selecting indexes to use & NOT INDEXED

2011-06-28 Thread Mohit Sindhwani
Hi Igor and Puneet, On 27/6/2011 11:47 PM, Igor Tandetnik wrote: > You can suppress the index on CAT with a unary plus operator, like this: > ... AND +CAT=25; Thanks for the suggestions. I'll try these :) Best Regards, Mohit. 28/6/2011 | 11:50 PM.

Re: [sqlite] Ensure that query acts on PRE-SORTED tables

2011-07-01 Thread Mohit Sindhwani
On 1/7/2011 5:37 PM, Martin.Engelschalk wrote: > Hi, > > i apologize beforehand if my post does not answer your question > directly. It seems to me that you may be missing a basic concept. > > Data in an SQL table is never sorted in itself. So, you can not sort a > table before you query it.

[sqlite] Text searching

2011-08-05 Thread Mohit Sindhwani
We have an interesting problem here that has me at my wit's end - so, I thought I'd ask for advice. We have a list of words that we want to quickly search. We used FTS3 for it and it is fast and works very well. The only problem is that it breaks the original entry at word boundaries

[sqlite] Unicode Confusion and Database Size

2011-09-01 Thread Mohit Sindhwani
Hi All, I apologize first if this question has its roots in my partial understanding of unicode and the various UTF-encodings. We're using Windows CE and SQLite3 - so far, we have only used ASCII data. Now, we're going to store data in other languages and feel the need to go towards

Re: [sqlite] Unicode Confusion and Database Size

2011-09-01 Thread Mohit Sindhwani
Hi Igor, On 1/9/2011 11:57 PM, Igor Tandetnik wrote: On 9/1/2011 10:24 AM, Mohit Sindhwani wrote: I understand that the database could be either UTF-8 or UTF-16 - but that would apply to the full DB not to a single column, right? Right. *many useful answers snipped* Thank you very much

Re: [sqlite] Unicode Confusion and Database Size

2011-09-03 Thread Mohit Sindhwani
Hi Igor, Thanks for your advice and guidance. On 1/9/2011 11:57 PM, Igor Tandetnik wrote: On 9/1/2011 10:24 AM, Mohit Sindhwani wrote: On the other hand, the other language that we are storing seems to require 3 bytes in UTF-8. Given that, it would appear that using UTF-8 would be a better

Re: [sqlite] Unicode Confusion and Database Size

2011-09-04 Thread Mohit Sindhwani
Hi Simon, On 4/9/2011 12:01 AM, Simon Slavin wrote: Have you tried speed tests on your platform ? It's hard to tell which will be faster because it depends on what language and OS you're using that interacts with SQLite. So if you have your schema designed and any part of your application

[sqlite] SQLite Cache Usage

2011-09-07 Thread Mohit Sindhwani
Hi All, We are right now reviewing our usage of SQLite3 and are seeing how we can optimize its usage of disk space, run-time memory and its performance for our applications. So far, we are discovering a lot of new things - and it's very interesting to see things we may have overlooked at

Re: [sqlite] SQLite Cache Usage

2011-09-07 Thread Mohit Sindhwani
Hi Pavel, On 7/9/2011 10:16 PM, Pavel Ivanov wrote: 1. If we have a 1MB cache (1000 pages x 1KB/page), is it allocated immediately and used or is it allocated as queries come in? Cache is not allocated immediately. It's allocated when SQLite needs to read something from disk (or write a newly

[sqlite] Can pre-sorted data help?

2011-10-07 Thread Mohit Sindhwani
Hi All, I have been trying to see how we can make one of our databases more space efficient. I am now looking at seeing if we have the right indexes and if there is a way to save space by removing indexes. Is there some way to make use of the fact that the data can be sorted by a specific

Re: [sqlite] Can pre-sorted data help?

2011-10-08 Thread Mohit Sindhwani
Hi Richard, On 8/10/2011 12:51 AM, Richard Hipp wrote: Hi All, I have been trying to see how we can make one of our databases more space efficient. I am now looking at seeing if we have the right indexes and if there is a way to save space by removing indexes. Have you run the

Re: [sqlite] Can pre-sorted data help?

2011-10-09 Thread Mohit Sindhwani
Thanks Richard and Petite, On 9/10/2011 1:05 AM, Richard Hipp wrote: On Fri, Oct 7, 2011 at 12:30 PM, Mohit Sindhwani<m...@onghu.com> wrote: Hi All, I have been trying to see how we can make one of our databases more space efficient. Have you tried increasing the page size? Yo

Re: [sqlite] Can pre-sorted data help?

2011-10-09 Thread Mohit Sindhwani
Hi Michael and Petite, Thanks for the replies. On 9/10/2011 10:08 PM, Petite Abeille wrote: On Oct 9, 2011, at 1:03 PM, Black, Michael (IS) wrote: For your example create a separate table with just the first letter and build an index on it. This is most likely pointless as the selectivity

Re: [sqlite] Can pre-sorted data help?

2011-10-09 Thread Mohit Sindhwani
Thanks Petite! On 9/10/2011 10:58 PM, Petite Abeille wrote: On Oct 9, 2011, at 4:49 PM, Mohit Sindhwani wrote: Maybe, if we had a column called 'published_date' and we did a query for data within a date range.. the fastest way to get the information back would be to have an index

[sqlite] FTS3/FTS4 - Finding the term(s) that completes the input

2011-11-20 Thread Mohit Sindhwani
) - an FTS4aux table What I'd like to be able to do is something like this: - let's say that the FTS4 table has values such as: * mohit sindhwani, onghu * john doe, gmail * james ling, alibaba * john barn, yahoo ...and so on If the user enters "j", I'd like to suggest that this woul

Re: [sqlite] FTS3/FTS4 - Finding the term(s) that completes the input

2011-11-20 Thread Mohit Sindhwani
Hi Abhinav, On 21/11/2011 2:52 AM, Abhinav Upadhyay wrote: On Mon, Nov 21, 2011 at 12:17 AM, Mohit Sindhwani<m...@onghu.com> wrote: What I'd like to be able to do is something like this: - let's say that the FTS4 table has values such as: * mohit sindhwani, onghu * john doe, gmail *

Re: [sqlite] FTS3/FTS4 - Finding the term(s) that completes the input

2011-11-21 Thread Mohit Sindhwani
Hi Filip, On 21/11/2011 4:33 PM, Filip Navara wrote: On Mon, Nov 21, 2011 at 4:13 AM, Mohit Sindhwani<m...@onghu.com> wrote: I think my examples muddied the waters. I have looked at Section 3 of the FTS documents and that lets me bring back the "full result" that matches -

Re: [sqlite] FTS3/FTS4 - Finding the term(s) that completes the input

2011-11-22 Thread Mohit Sindhwani
Hi Simon, Abhinav and Filip, On 21/11/2011 11:32 AM, Simon Slavin wrote: You have to look at the rows it returns and see how many of them there are. If there's only one, that's your hit. If there are more than one, see how many characters you can move along the row before they start to be

Re: [sqlite] Cache design using sqlite3...

2011-12-07 Thread Mohit Sindhwani
On 7/12/2011 6:33 AM, Simon Slavin wrote: Right. One way to do it is to have a table in the database used to point to the next database. Normally that table has zero rows in it. You can check it with SELECT COUNT(*) FROM databaseObsolete when an entry does appear in it the count switches

Re: [sqlite] command line to get number of tables in sqlite

2011-12-21 Thread Mohit Sindhwani
On 22/12/2011 7:25 AM, Matt Young wrote: select count() from sqlite_master; No?? ...where type='table'; Cheers, Mohit. 22/12/2011 | 12:51 PM. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] search

2011-12-27 Thread Mohit Sindhwani
On 27/12/2011 9:25 PM, Eduardo Morras wrote: At 11:27 27/12/2011, you wrote: Thank you. I agree. It's correct. I already have data base with /country/state/city/village format. Is it possible to do that while virtual table creation time? if yes, how? Change '/' to ','. This way you get a

[sqlite] attempt at output with thousands separator via extension

2015-11-23 Thread Mohit Sindhwani
On 23/11/2015 11:32 AM, Rowan Worth wrote: > Hi Bruce, > > I had a go at post-processing the sqlite3 shell's output to apply thousand > separators. I don't recommend looking too hard at the sed for the sake of > your sanity, but the gist is it repeatedly prepends a comma to trailing > groups of

Re: [sqlite] Books which cover C API

2010-07-07 Thread Mohit Sindhwani
On 8/7/2010 2:55 AM, Jay A. Kreibich wrote: > On Wed, Jul 07, 2010 at 07:45:02PM +0100, Andrew Wood scratched on the wall: > >> Which of the books on the market is the best for covering the C API? >> >http://sqlite.org/books.html > > > > >If you want to go out and buy something

Re: [sqlite] Books which cover C API

2010-07-07 Thread Mohit Sindhwani
On 8/7/2010 8:06 AM, Tito Ciuro wrote: > On 8 Jul 2010, at 01:58, Mohit Sindhwani<m...@onghu.com> wrote: > > >> On 8/7/2010 2:55 AM, Jay A. Kreibich wrote: >> >>> On Wed, Jul 07, 2010 at 07:45:02PM +0100, Andrew Wood scratched on the wall: >

Re: [sqlite] Books which cover C API

2010-07-07 Thread Mohit Sindhwani
On 8/7/2010 8:17 AM, Tito Ciuro wrote: > Yes. The book is quite good, I admit, but if you need to find specific > things... the answer might not be referenced where you think it'd be. Or not > mentioned at all. Is it really *that* difficult? I truly hope they pay > attention to this whenever in

[sqlite] Confused about Multiple Indexes

2010-11-25 Thread Mohit Sindhwani
Hi All, I am looking at a database that someone created earlier and for one of the table, the schema shows: CREATE TABLE tx (name TEXT, type INTEGER, seq INTEGER, seq_record TEXT, ...); CREATE INDEX IDX1 on tx(name ASC); CREATE INDEX IDX2 on tx(type, search_name ASC); I am under the impression

Re: [sqlite] Confused about Multiple Indexes

2010-11-26 Thread Mohit Sindhwani
Hi Swithun Thank you for your reply. I'm sorry I was simplifying the schema when I sent it out. On 26/11/2010 5:35 PM, Swithun Crowe wrote: > Hello > > MS> CREATE TABLE tx (name TEXT, type INTEGER, seq INTEGER, seq_record TEXT, > MS> ...); > > MS> CREATE INDEX IDX1 on tx(name ASC); > MS>

Re: [sqlite] Confused about Multiple Indexes

2010-11-26 Thread Mohit Sindhwani
On 26/11/2010 6:34 PM, Swithun Crowe wrote: > Hello > > CREATE INDEX idx ON tx(name ASC, type); > > With the columns in this order (name followed by type), the index will be > used for queries which have either just name, or both name and type in > their WHERE clauses. Swithun, thank you very

Re: [sqlite] Confused about Multiple Indexes

2010-11-26 Thread Mohit Sindhwani
Hi Max Thanks for the reply. On 26/11/2010 7:11 PM, Max Vlasov wrote: > Mohit said that he uses a someone's db, so I can imagine a possibility that > with two indexes ... > CREATE INDEX IDX1 on tx(name ASC); > CREATE INDEX IDX2 on tx(type, name ASC); > ... the creator of database wanted to

[sqlite] Optimizing Database Size

2011-02-02 Thread Mohit Sindhwani
Hi All, I'm facing an issue where we want to make the database size smaller than it is. 1. We are already using CEROD, so the final database is compressed. 2. We ran the sqlite_analyzer and identified the tables that take up a lot of space and are now re-organizing the schema. One thing I

Re: [sqlite] Optimizing Database Size

2011-02-02 Thread Mohit Sindhwani
Hi Simon, >> 1. We are already using CEROD, so the final database is compressed. >> >> 2. We ran the sqlite_analyzer and identified the tables that take up a >> lot of space and are now re-organizing the schema. One thing I observed >> is that we have a number of tables that have the same

[sqlite] Ideas for Searching Names in Contacts

2011-02-23 Thread Mohit Sindhwani
I am trying to build a simple contacts database in SQLite. I want people to be able to search starting with any word of the name. So, if I have: 1,John Smith 2,Simon James 3,Simon Kelly Smith 4,Jimmy Garcia 5,Smith White Jones 6,Simon Kelly Grant ... If a user types "Smi", he should get the

Re: [sqlite] Ideas for Searching Names in Contacts

2011-02-24 Thread Mohit Sindhwani
On 24/2/2011 1:49 AM, Simon Slavin wrote: > I would not try to make each individual word of a name a row in a table. I > think 'LIKE' is designed almost exactly for your problem: > > > > This means you can search on any component of the name. for

[sqlite] Considerations with in-memory SQLite3

2008-09-10 Thread Mohit Sindhwani
Hi Everyone, I'm new to the list and would like to start by saying hello! So, hello! I've been using SQLite3 for a while though to be honest, it's been more of a data store rather than a dynamic database in my applications this far. I'm now starting on something where my needs are as such: *

Re: [sqlite] Considerations with in-memory SQLite3

2008-09-10 Thread Mohit Sindhwani
Hi Richard Thanks for the quick response! D. Richard Hipp wrote: > On Sep 10, 2008, at 2:09 PM, Mohit Sindhwani wrote: > >> >> I've been using SQLite3 for a while though to be honest, it's been >> more >> of a data store rather than a dynamic database in my

Re: [sqlite] Considerations with in-memory SQLite3

2008-09-10 Thread Mohit Sindhwani
Ken wrote: > I'll take a stab at this. > > Each connection would have its own private memory database. > > Create an additional temp table id_list , Insert the user id set values into > this table. > > Then > INSERT INTO temptab tt SELECT mt.* FROM maintab mt, id_list >

Re: [sqlite] Considerations with in-memory SQLite3

2008-09-10 Thread Mohit Sindhwani
Ken wrote: > I'll take a stab at this. > > Each connection would have its own private memory database. > > Create an additional temp table id_list , Insert the user id set values into > this table. > > Then > INSERT INTO temptab tt SELECT mt.* FROM maintab mt, id_list >

Re: [sqlite] Considerations with in-memory SQLite3

2008-09-11 Thread Mohit Sindhwani
Dennis Cote wrote: > That looks right to me. > Thanks for the quick check, Dennis. > There is no need to create an index on the temporary id_list, since you > are going to be doing a full table scan of that table anyway. > >select * >from id_list >join mt.table on mt.table.id =

Re: [sqlite] best language match for SQLite?

2008-09-16 Thread Mohit Sindhwani
Jeff Godfrey wrote: > According to a paper written by Richard Hipp (the creator of SQLite), > Tcl is the ideal language. Here's a quote from the mentioned paper: > > "The increasing popularity of SQLite is seen in the fact that the main > website daily serves about a gigabyte of data to around

Re: [sqlite] [?? Probable Spam] Re: Vista frustrations

2008-09-19 Thread Mohit Sindhwani
Bogusław Brandys wrote: > Virgilio Alexandre Fornazin pisze: > >> Sure. I just tell to do this test to check if the bug is related to this >> component, since it debuted on Vista. >> >> > > Silly thought,but could it be related to database file extension ? I > mean , is it possible that

Re: [sqlite] SQLITE_CONFIG_SERIALIZED

2008-09-30 Thread Mohit Sindhwani
D. Richard Hipp wrote: > > SQLITE_CONFIG_SERIALIZED has been the default behavior since version > 3.5.0. All it does is move the locks to inside of SQLite so that your > application code does not have to mess with them. It does not > magically provide you any additional concurrency. >

[sqlite] Vacuum needed?

2008-10-26 Thread Mohit Sindhwani
I'm setting to to delete a bunch of old records ever 2 weeks in a cron job and initially I just wanted to do delete * from table where datetime(created_on, 'localtime') < some_date. Then, I remembered about vacuum - do I need to vacuum the database whenever I delete the records? Should I just

Re: [sqlite] Vacuum needed?

2008-10-26 Thread Mohit Sindhwani
Cory Nelson wrote: > On Sun, Oct 26, 2008 at 8:17 PM, Mohit Sindhwani <[EMAIL PROTECTED]> wrote: > >> I'm setting to to delete a bunch of old records ever 2 weeks in a cron >> job and initially I just wanted to do delete * from table where >> datetime(create

Re: [sqlite] Vacuum needed?

2008-10-27 Thread Mohit Sindhwani
D. Richard Hipp wrote: >> Though if your db has reached a steady-state size you might consider >> running a VACUUM just *before* deleting the records, to avoid peaks >> persisting ... and even then (say) every *other* week. >> Just a thought ! >> > VACUUM also defragments a database file

Re: [sqlite] Delete based on timestamp very slow

2008-11-07 Thread Mohit Sindhwani
dbikash wrote: > 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. > Bikash,

[sqlite] Working with a new DB every 5 minutes

2009-06-08 Thread Mohit Sindhwani
Hi Everyone, I'm having a problem that I'm trying to find an elegant solution to. I have a database that stores real-time information - this information is replaced by new values every 5 minutes and has about 30,000 entries. Once a new database is made available, I should start using that

Re: [sqlite] Working with a new DB every 5 minutes

2009-06-08 Thread Mohit Sindhwani
Pavel Ivanov wrote: >> * Getting rid of the old files - I'm on Windows and would need to see >> the equivalent way of your Unix suggestion. >> > > I don't think you have good options here. One option is to make > continuous retries while remove() returns error. Another option I > believe

Re: [sqlite] Working with a new DB every 5 minutes

2009-06-09 Thread Mohit Sindhwani
John Elrick wrote: > Simon Slavin wrote: > >> On 8 Jun 2009, at 8:07pm, Mohit Sindhwani wrote: >> >> >> >>> I'm having a problem that I'm trying to find an elegant solution >>> to. I >>> have a database that stores real-time in

Re: [sqlite] SQlite3 - SQL injection using ruby

2009-06-15 Thread Mohit Sindhwani
dave lilley wrote: > Sorry for posting twice but... > > how does the method you have given me differ to mine? > > eg lets say this is the scenario > > uservar = "delete * from customers where * = *" > > >>> e.g. stmt = "select * from customers where cust_no = #{uservar}" >>> row =

[sqlite] Find the letters that can follow the current text

2009-08-25 Thread Mohit Sindhwani
OK, I know the subject is difficult to understand but I want to use a sqlite table for auto-completion. So, suppose I have records that are like: ITEM0 ITS THERE ITS HERE ITIS NOW ITSY BITSY ITZ COOL And if the user has typed in "IT", I'd like to prompt him saying that the only letters that

Re: [sqlite] Find the letters that can follow the current text

2009-08-25 Thread Mohit Sindhwani
Pavel Ivanov wrote: > Maybe you want something like this: > > select distinct substr(col, length(?1), 1) > from table > where col like ?1||'%' > > Hi Pavel, thanks! It works..! Just a note: select distinct substr(col, length(?1), 1) should be select distinct substr(col, length(?1) + 1, 1) So,

Re: [sqlite] SQLite Tools

2009-08-25 Thread Mohit Sindhwani
BareFeet wrote: > Hi Barton, > > >> I saw all the tools listed on the SQLite wiki. I was hoping that I >> could solicit opinions on the various ones there to save me the time >> of trying all of them. >> > > I've tried several and posted a fairly detailed comparison at: >

[sqlite] Reading "packed" data

2009-09-19 Thread Mohit Sindhwani
Hi! An embedded SQL-based database that we used earlier had a concept of packed fetches - this would mean that we could create a certain buffer for results, prepare a query, execute it and read back the results in "groups" of 10 or 20 or 1000 (or "n") results per call.. this was significantly

Re: [sqlite] Reading "packed" data

2009-09-20 Thread Mohit Sindhwani
Igor Tandetnik wrote: > Mohit Sindhwani wrote: > >> Hi! An embedded SQL-based database that we used earlier had a concept >> of packed fetches - this would mean that we could create a certain >> buffer for results, prepare a query, execute it and read back the >

Re: [sqlite] Reading "packed" data

2009-09-20 Thread Mohit Sindhwani
Kees Nuyt wrote: > On Sun, 20 Sep 2009 12:02:17 +0800, Mohit Sindhwani > <m...@onghu.com> wrote: > > >> Hi! An embedded SQL-based database that we used earlier had a concept >> of packed fetches - this would mean that we could create a certain >> buffer f

Re: [sqlite] Reading "packed" data

2009-09-21 Thread Mohit Sindhwani
Simon Slavin wrote: > On 20 Sep 2009, at 8:06pm, Mohit Sindhwani wrote: > > >> I'm just trying to see if there's a way to move more data per request. >> But it seems not (for now). >> > > By all means write your own routine that calls _step lots of t

Re: [sqlite] Strange File Import Error

2009-09-22 Thread Mohit Sindhwani
Stephan Wehner wrote: > On Tue, Sep 22, 2009 at 3:04 PM, Simon Slavin > wrote: > >> On 22 Sep 2009, at 10:49pm, Simon Davies wrote: >> >> If you're going to need to import such files frequently, you might >> need to write some code to do the import properly. >>

Re: [sqlite] Fwd: sqlite3_prepare_v2

2009-10-01 Thread Mohit Sindhwani
D. Richard Hipp wrote: > Any windows users have ideas on how to help MCB? > It seems like there's a problem with paths. It seems that the "wrong" DLL is earlier in the path than the one that the application expects. Any idea which application has the problem? Is it iTunes? Cheers Mohit.

Re: [sqlite] Conflict with SQLite ODBC Driver and MS Office 2007 ?

2009-10-15 Thread Mohit Sindhwani
Shane Harrelson wrote: > I know of no conflicts. I regularly test against SQL Server 2005, > MySQL, OracleXE, and SQLite all via ODBC interfaces (specifically > Christian Werner's ODBC interface for SQLite). The various ODBC > interfaces all play happily. > ...and numerous applications

Re: [sqlite] I suspect not - but is the database separator configurable?

2013-02-01 Thread Mohit Sindhwani
Hi Marc, On 1/2/2013 10:42 PM, message adams wrote: My applications actually run against sybase, but I'd love to use a connection to an in-memory sqlite to carry out my testing. As part of the unit-test, I'd pass the sqlite conenction into my source code hoping it would be none the wiser. The

Re: [sqlite] I suspect not - but is the database separator configurable?

2013-02-01 Thread Mohit Sindhwani
Hi Ryan, On 2/2/2013 1:55 AM, Ryan Johnson wrote: That would break sybase, though: the quotes would also tell it to treat the db name and periods as part of the table name, too: sqlite3> create table foo(x,y); sqlite3> .tables foo sqlite3> select * from "main.foo"; Error: no such table:

Re: [sqlite] How to get the RecNo ???

2013-02-10 Thread Mohit Sindhwani
Hi Peter, I have been caught out on this. On 11/2/2013 8:40 AM, Peter Aronson wrote: You can add it to the select list as OID, ROWID or _ROWID_ or, if the table has a column defined INTEGER PRIMARY KEY (but not INTEGER PRIMARY KEY DESC) it'll also be this value. See:

Re: [sqlite] How to get the RecNo ???

2013-02-10 Thread Mohit Sindhwani
now - but inline. On 11/2/2013 11:45 AM, Igor Tandetnik wrote: On 2/10/2013 10:06 PM, Mohit Sindhwani wrote: The OP reads records in a loop. I imagine he or she may simply use a loop counter as a sequence number, if that's what is needed. However, I too read the original question as asking

Re: [sqlite] Run sqlite from a batch file

2013-03-01 Thread Mohit Sindhwani
Hi Rick, Welcome to the group! I get the feeling that you hijacked an earlier thread given the long bodies of text I removed from the email. Anyway, it's great to see a clear detailed email with the stuff you tried. The first thing I would check for is if sqlite3 is on the path of the

[sqlite] Slow sqlite3_open() - possible culprits?

2013-03-13 Thread Mohit Sindhwani
Hi, we are using SQLite3 + CEROD for a number of databases in an embedded systems application running on Windows CE. We're finding unexpectedly long time to open the database (0.5s ~ 2.8sec). Maybe, these times are reasonable, but they seem long to us. We are using:

Re: [sqlite] Slow sqlite3_open() - possible culprits?

2013-03-14 Thread Mohit Sindhwani
Hi Stephen, Thanks for the reply! On 14/3/2013 2:20 PM, Stephen Chrzanowski wrote: If you're attempting to open a read only SQLite database, it seems as though it will take that time to validate write permissions. By "read only", I meant that the database is for reading only. It doesn't

Re: [sqlite] Slow sqlite3_open() - possible culprits?

2013-03-15 Thread Mohit Sindhwani
Hi Richard, On 14/3/2013 8:17 PM, Richard Hipp wrote: On Thu, Mar 14, 2013 at 12:34 AM, Mohit Sindhwani <m...@onghu.com> wrote: Hi, we are using SQLite3 + CEROD for a number of databases in an embedded systems application running on Windows CE. We're finding unexpectedly long time t

Re: [sqlite] Slow sqlite3_open() - possible culprits?

2013-03-24 Thread Mohit Sindhwani
Hi! On 15/3/2013 11:40 PM, Mohit Sindhwani wrote: Hi Richard, On 14/3/2013 8:17 PM, Richard Hipp wrote: On Thu, Mar 14, 2013 at 12:34 AM, Mohit Sindhwani <m...@onghu.com> wrote: Hi, we are using SQLite3 + CEROD for a number of databases in an embedded systems application running on W

[sqlite] RTree Documentation Error?

2013-04-16 Thread Mohit Sindhwani
Hi, I was looking at the RTree documentation page with one of my colleagues - http://www.sqlite.org/rtree.html We tried the example with the schema in 3.1, populated the data from 3.2 and then queried it using the query of 3.3 - we got no results while the documentation says that "the query

Re: [sqlite] RTree Documentation Error?

2013-04-18 Thread Mohit Sindhwani
Hi Richard, et al, I'm sorry that it's bad manners for me to raise an issue and then disappear, but I didn't get a chance to check the list till a few minutes ago... On 17/4/2013 9:36 PM, Richard Hipp wrote: On Wed, Apr 17, 2013 at 9:25 AM, Michael Black wrote:

[sqlite] SEE + CEROD

2013-05-05 Thread Mohit Sindhwani
Hi Guys, We already have a license for CEROD and are now contemplating getting a license for SEE to use within our products. I notice that both products are separately provided as amalgamation sqlite3.c files. Is it possible to use these two together in the same system? Just looking for

Re: [sqlite] SEE + CEROD

2013-05-06 Thread Mohit Sindhwani
On 6/5/2013 7:24 PM, Richard Hipp wrote: Yes. SEE and CEROD can be combined to work together. Remember how with CEROD you append some code to the end of the sqlite3.c amalgamation file? SEE works the same way. To use them both, you just append both additions to the amalgamation. Thanks

[sqlite] Understanding how data is stored and the index is managed

2013-07-11 Thread Mohit Sindhwani
Hi All, We have a system in which there are around 3 million records in a particular table within SQLite3 on Windows CE. There is a primary key index on the table. We are selecting 1200 records from the table using a prepare - bind - step - reset approach. We find the time seems

Re: [sqlite] Understanding how data is stored and the index is managed

2013-07-12 Thread Mohit Sindhwani
Hi Simon, As always thanks for your prompt reply. My answers inline. On 12/7/2013 1:11 PM, Simon Slavin wrote: On 12 Jul 2013, at 5:19am, Mohit Sindhwani <m...@onghu.com> wrote: We could try to renumber the IDs so that all the IDs are in sequence, but that is not the easiest thing

Re: [sqlite] Understanding how data is stored and the index is managed

2013-07-13 Thread Mohit Sindhwani
Hi Mike, Thanks for the steps to try. I was hoping for some theoretical (implementation) insight before we do the normal battery of tests... we'll get onto that next week if there are no other inputs on how data storage is handled. On 12/7/2013 8:36 PM, Michael Black wrote: One more test

Re: [sqlite] to encrypt sqlite db

2013-08-31 Thread Mohit Sindhwani
On 31/8/2013 8:40 PM, Paolo Bolzoni wrote: There is a non-free version of sqlite that encrypt the db. If it is that you want then you have to contact them directly. Otherwise just use sqlite on a EncFs mounted disk? Adding on to Paolo's answer, see this:

Re: [sqlite] to encrypt sqlite db

2013-09-01 Thread Mohit Sindhwani
On 31/8/2013 9:52 PM, dd wrote: Thank you for your quick response. I am looking for freeware. If freeware not available, I have to implement encryption support for sqlite on winrt. What is the procedure to implement encryption support on winrt? Thanks, dd Many others have replied with the

[sqlite] Out of memory error

2013-09-09 Thread Mohit Sindhwani
Hi Guys, I have hit a new problem and would like some advice if there's a way around it. Error: near line 2: out of memory Basically, I have a table with 291 columns, 1.5 million rows. 288 columns have numeric values, additionally there is an itenid and day. I want to use SQL to basically

Re: [sqlite] Out of memory error

2013-09-09 Thread Mohit Sindhwani
Hi Richard On 9/9/2013 11:10 PM, Richard Hipp wrote: SQLite does not normally *require* a lot of memory. (But it generally runs faster the more memory you give it, so the default configuration is to use as much as it wants.) That is what I have always observed. I'm guessing you have set

  1   2   >