[horde] share sql driver and bitwise operations
Michael Rubinsky
mrubinsk at horde.org
Thu Sep 18 15:01:42 UTC 2008
Quoting Chuck Hagenbuch <chuck at horde.org>:
> Quoting Leena Heino <Leena.Heino at uta.fi>:
>
>> Hello,
>>
>> It seems that these bitwise operations in share sql-driver is a
>> major performance killer at least in MySQL. This seems to be
>> because SQL's bitwise operations do not use index in MySQL and
>> therefore each query made in share sql-driver has to make a full
>> table scan.
>>
>> Would it be possible to change the database schema and the code so
>> that each permission to different user type (creator/default/guest)
>> would be stored in its own column and therefore we would have
>> columns like perm_creator_show, perm_creator_read,
>> perm_creator_edit and perm_creator_delete. This would allow us to
>> ditch the bitwise operations in the query.
>
> I think this is a good idea, and if possible we should do it for
> Horde 3.3. Please create a ticket on bugs.horde.org to track it.
>
> Also, we don't have a clear MySQL version requirement, so going to
> subqueries/union is probably not feasible yet (we should require
> MySQL 4.1 or maybe 5.0+ for Horde 4), but we should explore making
> two separate queries and joining the results in PHP. With some
> caching, the simplicity of two fast queries might be better than the
> join.
I agree this is a good idea, provided the speed gained from the faster
queries isn't lost in merging the results in PHP.
The only issue/concern that comes to mind is how would we handle
"custom" perms. For instance, in Kronolith we use a PERMS_DELEGATE
constant.
Thanks,
mike
--
The Horde Project (www.horde.org)
mrubinsk at horde.org
"Time just hates me. That's why it made me an adult." - Josh Joplin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: PGP Digital Signature
URL: <http://lists.horde.org/archives/horde/attachments/20080918/cdbc34bc/attachment.bin>
More information about the horde
mailing list