Re: [sqlite] Expression Indexes - can I project the expression value from the index?

2016-08-31 Thread Deon Brewis
Thanks! I'll be willing to test this beta once it's available. One more thing - I think there is a bug here in the query planner if there is an indexed expression in an index. It doesn't seem to think an index is ever covering if the inputs to the expression isn't in the index as well. E.g.

Re: [sqlite] Expression Indexes - can I project the expression value from the index?

2016-08-31 Thread Deon Brewis
Sorry! My bad. I work in one of those shops where everything from a feature request, to a task, to a customer support issue, to an actual software defect is referred to as a "bug". I forget it doesn't always translate. Thanks for looking into it! - Deon -Original Message- From:

Re: [sqlite] Expression Indexes - can I project the expression value from the index?

2016-08-31 Thread Richard Hipp
On 8/31/16, Deon Brewis wrote: > Thanks! I'll be willing to test this beta once it's available. > > One more thing - I think there is a bug here in the query planner I'm pedantic about this because it is important: What you describe is not a bug. A bug means it gets the

Re: [sqlite] Why MMAP return ENOMEM in SQLite?

2016-08-31 Thread sanhua.zh
Thanks for your answer. Simon Why are you trying to do memory-mapping on a portable device ? Is it for speed ? Do you absolutely need it ? Yes. even on iDevice, [mmap] can get faster than sequential I/O. Sometimes it will be twice faster. Simon Won't the standard SQLite API do the job well

Re: [sqlite] Why MMAP return ENOMEM in SQLite?

2016-08-31 Thread Stephan Beal
On Wed, Aug 31, 2016 at 10:39 AM, sanhua.zh wrote: > In my testcase, I can only [mmap] a db file at most 1.4GB size. But in > this new way, I can map a file at most 3.2GB. The test device is iPhone 6S. > According to google, the iPhone 6s only has 2GB of RAM, so you can't

Re: [sqlite] Why MMAP return ENOMEM in SQLite?

2016-08-31 Thread Stephan Beal
On Wed, Aug 31, 2016 at 10:43 AM, Stephan Beal wrote: > On Wed, Aug 31, 2016 at 10:39 AM, sanhua.zh wrote: > >> In my testcase, I can only [mmap] a db file at most 1.4GB size. But in >> this new way, I can map a file at most 3.2GB. The test device

Re: [sqlite] Why MMAP return ENOMEM in SQLite?

2016-08-31 Thread sanhua.zh
Yes, [mmap] can be larger than physical memory. And what do you think about the new mapping way I mentioned ? 原始邮件 发件人:Stephan bealsgb...@googlemail.com 收件人:SQLite mailing listsqlite-us...@mailinglists.sqlite.org 发送时间:2016年8月31日(周三) 16:53 主题:Re: [sqlite] Why MMAP return ENOMEM in SQLite? On

Re: [sqlite] Why MMAP return ENOMEM in SQLite?

2016-08-31 Thread sanhua.zh
Why do you think it will corrupt the database? Can you give me more explainations or examples? 原始邮件 发件人:Stephan bealsgb...@googlemail.com 收件人:SQLite mailing listsqlite-us...@mailinglists.sqlite.org 发送时间:2016年8月31日(周三) 16:57 主题:Re: [sqlite] Why MMAP return ENOMEM in SQLite? On Wed, Aug 31,

Re: [sqlite] Why MMAP return ENOMEM in SQLite?

2016-08-31 Thread sanhua.zh
OK, I get your idea. Thanks for your advice. :) 原始邮件 发件人:Stephan bealsgb...@googlemail.com 收件人:SQLite mailing listsqlite-us...@mailinglists.sqlite.org 发送时间:2016年8月31日(周三) 17:09 主题:Re: [sqlite] Why MMAP return ENOMEM in SQLite? On Wed, Aug 31, 2016 at 11:03 AM, sanhua.zh sanhua...@foxmail.com

Re: [sqlite] Issue with entity framework

2016-08-31 Thread Lloyd
DB first worked for me. But I didn't find it documented that code first wont work. On Tue, Aug 30, 2016 at 7:06 PM, grégoire saint-ellier < greg.stell...@gmail.com> wrote: > Thank you for your answer. So wich approach should I use ? DB first? Code > First ? > > Regards > > 2016-08-30 14:08

Re: [sqlite] Why MMAP return ENOMEM in SQLite?

2016-08-31 Thread Simon Slavin
On 31 Aug 2016, at 4:40am, sanhua.zh wrote: > Is it caused by mmap file too big that the address space is not enough? Yes. Under iOS, memory maps can only be as big as the available physical memory. You're working on a tiny multi-tasking device and memory is at a

Re: [sqlite] Why MMAP return ENOMEM in SQLite?

2016-08-31 Thread sanhua.zh
Thanks for your answer. Simon Why are you trying to do memory-mapping on a portable device ? Is it for speed ? Do you absolutely need it ? Yes. even on iDevice, [mmap] can get faster than sequential I/O. Sometime it will be twice faster. Simon Won't the standard SQLite API do the job well

Re: [sqlite] Why MMAP return ENOMEM in SQLite?

2016-08-31 Thread Stephan Beal
On Wed, Aug 31, 2016 at 10:55 AM, sanhua.zh wrote: > Yes, [mmap] can be larger than physical memory. > Indeed, my mistake. > And what do you think about the new mapping way I mentioned ? > i think it's a "huge can of worms" - it's asking for more, bigger problems than

Re: [sqlite] Why MMAP return ENOMEM in SQLite?

2016-08-31 Thread Stephan Beal
On Wed, Aug 31, 2016 at 11:03 AM, sanhua.zh wrote: > Why do you think it will corrupt the database? > Can you give me more explainations or examples? > It's only my intuition - i don't have a concrete example. sqlite and ios are "well-oiled machines." They do their jobs

Re: [sqlite] Why MMAP return ENOMEM in SQLite?

2016-08-31 Thread sanhua.zh
Unless your users have complained about speed, this does not matter. There is no need to make everything happen as fast /as possible/. Try using just standard SQLite and find out if it is fast /enough/. Then you don't have to spend lots of programming time learning tiny little details about one

Re: [sqlite] Why MMAP return ENOMEM in SQLite?

2016-08-31 Thread Simon Slavin
On 31 Aug 2016, at 9:39am, sanhua.zh wrote: > Yes. even on iDevice, [mmap] can get faster than sequential I/O. Sometime it > will be twice faster. Unless your users have complained about speed, this does not matter. There is no need to make everything happen as fast

[sqlite] Bad Date headers when downloading from sqlite.org

2016-08-31 Thread Andy Wingo
Hi, If I download a sqlite, here is the first bit of a wget transcript: $ wget -S https://sqlite.org/2016/sqlite-autoconf-3140100.tar.gz --2016-08-30 23:15:34-- https://sqlite.org/2016/sqlite-autoconf-3140100.tar.gz Resolving sqlite.org (sqlite.org)... 2600:3c00::f03c:91ff:fe96:b959,

Re: [sqlite] REQUETES

2016-08-31 Thread Igor Korot
Hi, On Wed, Aug 31, 2016 at 9:14 AM, REGIANY Lucie wrote: > > HELLO > I WOULD DO SELECT FROM MY TABLE > select * > FROM "_L93_ZONAGES_exportdirectory_list" > WHERE "_L93_ZONAGES_exportdirectory_list".'TYPE' LIKE 'TAB%' > OR > "_L93_ZONAGES_exportdirectory_list".'TYPE'

[sqlite] Virtual table

2016-08-31 Thread Maria de Jesus Philadelpho
Hi, I implement the SQLite extension, virtcsv, which allows attaching a CSV file as a virtual table. At a command line everything works just fine, why I can't see the result of a select * from table using the SQLitestudio 3.0.7? See the attached snapshot. regards, Maria Azevedo --

[sqlite] Expression Indexes - can I project the expression value from the index?

2016-08-31 Thread Deon Brewis
Let's say I have an expression index: CREATE INDEX FOOINDEX on FOO(func(col)) And then I use that index: SELECT bar FROM FOO INDEXED BY FOOINDEX WHERE func(col) = 42; I can see that it will use the stored value, since if I put a breakpoint on func, it won't hit. Good and well. HOWEVER, if I

Re: [sqlite] REQUETES

2016-08-31 Thread Brice André
Hello, Maybe replace "ZONAGES_SHP_TAB2016".'identifiant' by "ZONAGES_SHP_TAB2016"."identifiant" or by "ZONAGES_SHP_TAB2016".identifiant ? Regards, Brice 2016-08-31 15:21 GMT+02:00 Igor Korot : > Hi, > > On Wed, Aug 31, 2016 at 9:14 AM, REGIANY Lucie

[sqlite] REQUETES

2016-08-31 Thread REGIANY Lucie
HELLO I WOULD DO SELECT FROM MY TABLE select * FROM "_L93_ZONAGES_exportdirectory_list" WHERE "_L93_ZONAGES_exportdirectory_list".'TYPE' LIKE 'TAB%' OR "_L93_ZONAGES_exportdirectory_list".'TYPE' LIKE 'SHP%' AND AND SAVE THE RESULT IN A NEW TABLE ZONAGES__SHP_ TAB2016 I WOULD DO SELECT FROM MY

Re: [sqlite] Why MMAP return ENOMEM in SQLite?

2016-08-31 Thread Simon Slavin
On 31 Aug 2016, at 12:28pm, sanhua.zh wrote: > BTW, what do you think if I mapseparatly instead of the whole db file, which > is the way I mentioned before ? Sorry but I have no experience with that. I hope other people can advise you. Simon.

Re: [sqlite] Why MMAP return ENOMEM in SQLite?

2016-08-31 Thread Scott Robison
On Aug 31, 2016 5:29 AM, "sanhua.zh" wrote: > > BTW, what do you think if I mapseparatly instead of the whole db file, ... I suspect that it wouldn't really help you much, if any. One, there is overhead in making that many system calls to map a bunch of 4 MiB buffers.

Re: [sqlite] Expression Indexes - can I project the expression value from the index?

2016-08-31 Thread Richard Hipp
On 8/31/16, Deon Brewis wrote: > > CREATE INDEX FOOINDEX on FOO(func(col)) > > HOWEVER, if I run: > SELECT func(col) FROM FOO INDEXED BY FOOINDEX WHERE func(col) = 42; > > It will execute the breakpoint on func(col) for every row in the table, even > though FOOINDEX is a