Re: [sqlite] suggestion: bitwise shift right optimization

2010-07-20 Thread Max Vlasov
> In the case of SQLite, it is also very unlikely to save space. In > fact, because of the way integer values are stored, it is very > likely to use more space. > Jay, In most cases yes, but there are ones with several integers that should be used together in ordering, the space is wasted sin

Re: [sqlite] suggestion: bitwise shift right optimization

2010-07-20 Thread Jay A. Kreibich
On Tue, Jul 20, 2010 at 04:43:26PM +0400, Max Vlasov scratched on the wall: > Hi, > as long as I see currently bitwise right does not use index Doing this requires recognizing when an inverse expression exists, and then computing it. It is extremely difficult in the general case. If you wa

Re: [sqlite] suggestion: bitwise shift right optimization

2010-07-20 Thread Max Vlasov
On Tue, Jul 20, 2010 at 5:14 PM, Pavel Ivanov wrote: > > Are there reasons not to implement optimization in the first case? Except > > for this is not most requested one :) > > I guess because this case is highly specific and it's behavior should > depend on particular constants used. Put there f

Re: [sqlite] suggestion: bitwise shift right optimization

2010-07-20 Thread Pavel Ivanov
> Are there reasons not to implement optimization in the first case? Except > for this is not most requested one :) I guess because this case is highly specific and it's behavior should depend on particular constants used. Put there for example Id >> 54 = 1000 and now we should make optimizer gues

[sqlite] suggestion: bitwise shift right optimization

2010-07-20 Thread Max Vlasov
Hi, as long as I see currently bitwise right does not use index CREATE TABLE [TestTable] ([Id] INTEGER PRIMARY KEY AUTOINCREMENT); EXPLAIN QUERY PLAN SELECT * FROM TestTable WHERE Id >> 12 = 1000; : TABLE TestTable Sure I can replace it with the following query EXPLAIN QUERY PLAN SELECT * FROM