[sqlite] Python program to convert CSV to sqlite

2018-01-17 Thread Simon Slavin
csvs-to-sqlite Simple command line makes simple SQLite table definitions. Or you can get fancy with the command line and it will create tables linked with foreign keys, or add a column with the filename to a table, or do other things. I have not trie

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Shane Dev
> Any practical realtime video game using SQLite is probably > doing so only to save and restore the game board between games. and perhaps calculating the initial "maze" or other non time sensitive data processing > Even a cursory look into production > quality video game development will tell

Re: [sqlite] Speed issue of SELECT in my application

2018-01-17 Thread Nick
Thank you all. As Simon said, 60ms may be a reasonable figure and I am trying to focus on the detail of my service according to all your suggestion. -- Sent from: http://sqlite.1065341.n5.nabble.com/ ___ sqlite-users mailing list sqlite-users@mailingli

Re: [sqlite] Speed issue of SELECT in my application

2018-01-17 Thread Nick
Jens, I totally agree with your opinion of profile. I have tried to find some useful tools to profile applications using sqlite and all I found is sqlite3_profile()(gettimeofday) and vdbe_profile(hardware time) inside sqlite. I also know a little about Time Profile of Instruments but I am using A

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread petern
FYI. 2D/3D game usability is extremely sensitive to response time. A stock in-memory SQLite database with plenty of memory is still too slow for tracking the state of an interactive graphical game especially on portable grade cpus. Any practical realtime video game using SQLite is probably doing

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Shane Dev
In my day job, I am an SAP consultant - for over 20 years. Production quality code? Yes, but only within the companies where I have worked - tax, banking, inventory, procurement, sales, etc. My interest in SQLite is a personal hobby project at the moment. I have a couple of ideas for end user appl

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Richard Hipp
On 1/17/18, petern wrote: > > Richard, since you're responding to questions, let me ask again about 3.22 > INTROPECTION_PRAGMAS release. No. We are past pencils-down. No new features at this point. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread petern
csv.c isn't a writer. Shane expected to write the file by inserting rows into the vtable. He has no application whatsoever but for the shell. Richard, since you're responding to questions, let me ask again about 3.22 INTROPECTION_PRAGMAS release. Will function_list() be progressing at all toward

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Richard Hipp
On 1/17/18, petern wrote: > Take a look at the function shell_callback for hints. If the goal is to create a TSV reader/writer, it seems like the CVS reader/writer might be a better starting point, as it is unencumbered by lots of other unrelated features as is the shell. You might be able to ge

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread petern
Take a look at the function shell_callback for hints. See the MODE_Csv case. You could start by cribbing the functions MODE_Csv uses for your own row handler and then see what you'll have to figure out yourself. Typically, if you are a serious product developer at a frontier in the market, you wil

Re: [sqlite] Speed issue of SELECT in my application

2018-01-17 Thread Simon Slavin
Folks. Nick published a figure of 60ms for his search. That’s not unusually slow. There was no request to shave every last millisecond off that figure. There wasn’t even a statement that it was too slow. No need to scare the guy by mentioning twenty complications of SQLite which may be irre

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Peter Da Silva
On 1/17/18, 11:07 AM, "sqlite-users on behalf of Jens Alfke" wrote: > If I were tackling this, I’d look for an open-source CSV parser/generator > library. Once you have that, the part that reads/writes the rows to the > database is pretty simple. If they’re reading tab separated files, I woul

Re: [sqlite] Speed issue of SELECT in my application

2018-01-17 Thread Jens Alfke
> On Jan 17, 2018, at 6:08 AM, Dominique Devienne wrote: > > you gain much faster table scans, because you no longer have to read those > large columns when going from row to row during a scan. I don’t see how this helps Nick's specific query, though, since it fetches all of the text columns

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Jens Alfke
> On Jan 17, 2018, at 3:53 AM, Bart Smissaert wrote: > > You don't have to, just need a different wheel. If I were tackling this, I’d look for an open-source CSV parser/generator library. Once you have that, the part that reads/writes the rows to the database is pretty simple. —Jens ___

Re: [sqlite] Speed issue of SELECT in my application

2018-01-17 Thread Dominique Devienne
On Wed, Jan 17, 2018 at 3:44 PM, David Raymond wrote: > sqlite_autoindex_t1_1 is the index created by the unique constraint in the > schema, it's not a temporary index. Thanks. That name fouled me indeed. --DD ___ sqlite-users mailing list sqlite-user

Re: [sqlite] Speed issue of SELECT in my application

2018-01-17 Thread David Raymond
sqlite_autoindex_t1_1 is the index created by the unique constraint in the schema, it's not a temporary index. -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Dominique Devienne Sent: Wednesday, January 17, 2018 9:08 AM To: SQLite

Re: [sqlite] Speed issue of SELECT in my application

2018-01-17 Thread Bart Smissaert
> 3. Start a transaction and hold the DB read locks for the duration of your application (again, if it won't need writing) I had a look at this but couldn't see a speed increase. This was for a single statement, so that is repeated (in a loop) sqlite3_step, sqlite3_column_xxx etc. In what situatio

Re: [sqlite] Speed issue of SELECT in my application

2018-01-17 Thread Dominique Devienne
On Wed, Jan 17, 2018 at 1:06 PM, Nick wrote: > What is more important is that, I think it is a better way to establish my > tables according to however the source data is. Because SQLite stores all cells in-row, including large text and blob columns, a common advise from the community is to den

Re: [sqlite] Crash when querying a unique index containing 12 columns using sub-selects

2018-01-17 Thread Matthew Towler
Hi > I think it is now back to Matthew to come up with a new test case that > actually demonstrates his problem. I believe I stated in my earlier message that the example test code did not show the issue - apologies that you spent time re-proving this. What would really help me to achieve a fa

Re: [sqlite] Speed issue of SELECT in my application

2018-01-17 Thread Nick
I am confused about your table t2. It will be faster to query the table t1, but I need the content of column e and h when I query the data which means I need a extra SELECT from the table t2, is it right? At the same time, I guess it is more complicate to INSERT data into both t1 and t2. What is

Re: [sqlite] Speed issue of SELECT in my application

2018-01-17 Thread Nick
Thank you Smith. The table is preseted with some data in my Android system. And I guess my APPLICATION is more like a SERVICE which will be started at system boot time and speed issue happens at the time. According to the some other reasons, I have to use wal+normal journal and sync mode. >3. Star

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Bart Smissaert
> I try very hard not to reinvent the wheel You don't have to, just need a different wheel. I did this recently both for .csv and also for .html and working very nicely and far more flexible than using the code in shell.c. RBS On Wed, Jan 17, 2018 at 10:54 AM, Shane Dev wrote: > On 17 January

Re: [sqlite] c program which performs the same function as the SQLite shell command ".import"

2018-01-17 Thread Shane Dev
On 17 January 2018 at 08:45, petern wrote: > Shane. Expect to do a lot of hacking on shell.c. It's not intended as a > library but as the main program of a console application. That's a shame. I try very hard not to reinvent the wheel especially when the wheel question (shell.c) is widely used

Re: [sqlite] Speed issue of SELECT in my application

2018-01-17 Thread Eduardo
On Wed, 17 Jan 2018 10:48:10 +0200 R Smith escribió: > Hang on a second - True, there is nothing to be done to improve the > speed of that specific Query - BUT - there is plenty to be done to > improve the speed of the database for your specific use case. The usual > suspects that comes to min

Re: [sqlite] Speed issue of SELECT in my application

2018-01-17 Thread R Smith
On 2018/01/17 8:48 AM, Nick wrote: Thank you Simon. As you said, UNIQUE(b, i) is redundant, but I guess it will not affect the performance of the SELECT. I find "SEARCH TABLE t1 USING INDEX sqlite_autoindex_t1_1 (b>?)" when I use EXPLAIN QUERY PLAN, so I do not need to add any index, right? Um

Re: [sqlite] Infinite loop when updating indexed with case and where clause

2018-01-17 Thread Simon Slavin
On 17 Jan 2018, at 8:40am, Christian Höhne wrote: > Please unsubscribe me. This list is run by computer. At the bottom of every post, including this one, is a link which will allow you to unsubscribe yourself. Simon. ___ sqlite-users mailing list

Re: [sqlite] Infinite loop when updating indexed with case and where clause

2018-01-17 Thread Christian Höhne
Please unsubscribe me. Christian Hoehne Il 16 gen 2018 13:34, "Harald Klimach" ha scritto: > Hi there, > > here is a weird behavior I observe with the following kind of setup: > > BEGIN TRANSACTION; > CREATE TABLE simple("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "lft" > INTEGER, "rgt" IN