Hi,

Can I add my very first piece of advice after listening and reading for the 
last 6-9 months :)

I’ll second what Simon says, I use the very same technique for a table with 4M+ 
records in and its so fast I thought I had an error and looked for bugs in my 
code.  I assumed (incorrectly) that it would be very slow, It isn’t. 

I’ll also add one other piece of advice to the people clogging up the list on 
hot journals with childish comments. I’m a very old developer, C and UNIX, well 
into my 4th decade of programming. I have learnt over the years that some 
things I know very well and some things (SQL and SQLIte are excellent examples) 
I’m a novice and a noob and a newbie and all those other words we use. This 
list is an excellent source of knowledge and very valuable (both in terms of 
time and money). I have learnt an awful lot from reading the mails here, there 
are often very good questions and normally excellent answers from people who 
take a significant amount of time to understand the problem and to write 
comprehensive replies. I thank all the people who write such good replies and 
maintain the high quality of the mailing list. It is very rare indeed to have 
short and curt answers to people who make the effort to write a decent question.

Whilst I cannot add much to any SQL discussion (point one above excepted, of 
which I’m sinfully proud to have contributed something at long last, even if 
its only to confirm what somebody else has done), I have come to realise that 
the people who answer here are real experts, I will not embarrass them by 
naming names, and if they say something which disagrees with what I think or 
have done, my first thought now is to challenge what I think and how I do it, 
because there is a very, very, very good chance I am wrong and the people here 
on the list are right. I’m old enough not to be bothered by admitting I got it 
wrong, and that other people know SQLite better than I do. 

There, I’ll now go back to the rock from which I came and lurk for another 9 
months :)

Thanks for all the input and very best wishes,

Rob



On 16 Jul 2014, at 06:48, Simon Slavin <slav...@bigfraud.org> wrote:

> 
>> On 16 Jul 2014, at 3:21am, jose isaias cabrera <cabr...@wrc.xerox.com> wrote:
>> 
>> SELECT * from startcodes where code = 'e';
>> 
>> but I want to search only from id >= 8 and <= 14.  Is there a way to set the 
>> boundary for that SELECT that will only search ids 8-14?  I know I can do a 
>> WHERE id BETWEEN 8 AND 14, but is there another faster way?
> 
> That way is not particularly slow.  You just need to have a good index.  A 
> good index for that search would be
> 
> CREATE INDEX sci ON startcodes (code,id)
> 
> You will find that that SELECT will then be blisteringly fast even with 
> millions of rows in your table.
> 
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to