Re: [sqlite] Two equivalent queries with very different perf

2014-05-25 Thread RSmith
On 2014/05/26 00:22, Andrew Arnott wrote: I'm using C# with SQLite.cs and SQLiteAsync.cs. I started with the slow version and upon realizing perf was *really* bad I experimented with different forms and discovered the fast version worked great. On Windows Phone 8.1, the slow one took ~20

Re: [sqlite] Two equivalent queries with very different perf

2014-05-25 Thread Keith Medcalf
The queries are identical and you should have similar performance on each assuming that you have the correct indexes defined. I presume you have indexes on Message(RemoteContactID, Id) and Attachment(MessageId)? If you do not, then if you only have indexes on Message(Id), the first will be

Re: [sqlite] Two equivalent queries with very different perf

2014-05-25 Thread Simon Slavin
On 25 May 2014, at 11:22pm, Andrew Arnott wrote: > It isn't clear why the slow one would be so much slower. Compare the two query plans using EXPLAIN QUERY PLAN SELECT ... with each one: > Is there > an opportunity here to

Re: [sqlite] Two equivalent queries with very different perf

2014-05-25 Thread Scott Robison
On Sun, May 25, 2014 at 4:22 PM, Andrew Arnott wrote: > It isn't clear why the slow one would be so much slower. In my naïve > opinion the query analyze in SQLite should recognize and treat these two as > the same but obviously the execution strategy is vastly different.

[sqlite] Two equivalent queries with very different perf

2014-05-25 Thread Andrew Arnott
I'm using C# with SQLite.cs and SQLiteAsync.cs. I started with the slow version and upon realizing perf was *really* bad I experimented with different forms and discovered the fast version worked great. On Windows Phone 8.1, the slow one took ~20 seconds to execute while the fast one was well

Re: [sqlite] Simple Select from IN - from a newbie.

2014-05-25 Thread Simon Slavin
On 25 May 2014, at 9:23pm, RSmith wrote: > On the plus side, they are mostly free and even the most expensive ones > doesn't come near what Stephen paid (All I can say to him is: Dude, you wuz > robbed). The rise of the internet has changed the way people learn computer

Re: [sqlite] Simple Select from IN - from a newbie.

2014-05-25 Thread RSmith
On 2014/05/25 19:37, Humblebee wrote: Thanks for the tip about the online course with an instructor. I will look into online courses, although the 5 digits is a bit outside of my limited budget. Learning is generally a very personal thing and there are many ways to take in information. I

[sqlite] vtable vs. OR condition

2014-05-25 Thread András Kardos
Hello, As an expoeriment I'd like to create various virtual tables (vtable) for SQLite. Like filysystem, process list, mailbox - all local or remote. The idea is to use SQLite as an unified API and query processor to access or join data from various sources. I read an old old article in Dr. Dobbs

Re: [sqlite] Simple Select from IN - from a newbie.

2014-05-25 Thread Humblebee
Thanks for the tip about the online course with an instructor. I will look into online courses, although the 5 digits is a bit outside of my limited budget. Learning is generally a very personal thing and there are many ways to take in information. I have to say that I learned so much from

Re: [sqlite] Simple Select from IN - from a newbie.

2014-05-25 Thread Stephen Chrzanowski
@OP: This isn't meant as something to be meant as mean, but I'd recommend taking an online course for SQL in general. There are some free sites, there are a lot more paid sites. I did my SQL training back when SQL 2000 was just coming out, and I paid 5 digits for the course. Those five digits

Re: [sqlite] Simple Select from IN - from a newbie.

2014-05-25 Thread Kees Nuyt
On Sat, 24 May 2014 22:24:01 +0200, RSmith wrote: > INSERT OR UPDATE TeamPersonTable (tpId,teamId,personId,orderId) > VALUES (1,3,4,0),(2,3,5,1),(3,7,4,1),(4,7,5,0); That will raise a syntax error. Make it: INSERT OR REPLACE INTO TeamPersonTable