Re: [sqlite] Optimizing 'ends with' queries

2009-08-23 Thread Simon Slavin
On 24 Aug 2009, at 5:05am, Tito Ciuro wrote: > What I meant is that if a table contains several columns, some or all > of which need to be searched using 'ends with', then replicating the > columns (by reversing the string) and keeping extra indices could > potentially affect performance

Re: [sqlite] Optimizing 'ends with' queries

2009-08-23 Thread Tito Ciuro
Hi Simon, On Aug 23, 2009, at 8:52 PM, Simon Slavin wrote: > > On 24 Aug 2009, at 4:22am, Tito Ciuro wrote: > >> But that would introduce the overhead of doubling the space required >> for every string + an additional column index. > > One of the options I mentioned was to store the reversed

Re: [sqlite] Optimizing 'ends with' queries

2009-08-23 Thread Simon Slavin
On 24 Aug 2009, at 4:22am, Tito Ciuro wrote: > But that would introduce the overhead of doubling the space required > for every string + an additional column index. One of the options I mentioned was to store the reversed string and not the original. If you need to reconstruct the original

Re: [sqlite] Optimizing 'ends with' queries

2009-08-23 Thread Tito Ciuro
Hi Simon, But that would introduce the overhead of doubling the space required for every string + an additional column index. If the schema contains more columns where this type of query needs to take place, it seems to me that this would not be a good solution. Thanks for your help, --

Re: [sqlite] Optimizing 'ends with' queries

2009-08-23 Thread Simon Slavin
On 24 Aug 2009, at 3:44am, Tito Ciuro wrote: > Is there a way to optimize this type of queries? (column Value is > indexed): > > SELECT Value FROM MyValues WHERE Value LIKE '%crashed.' > > I've seen the document where 'begins with' queries can be optimized > using >= and < (end of the '4.0 The

[sqlite] Optimizing 'ends with' queries

2009-08-23 Thread Tito Ciuro
Hello, Is there a way to optimize this type of queries? (column Value is indexed): SELECT Value FROM MyValues WHERE Value LIKE '%crashed.' I've seen the document where 'begins with' queries can be optimized using >= and < (end of the '4.0 The LIKE optimization' section):