6.0.0-alpha12
▾
Tasks
New Task
Search
▾
Others
Photos
Wiki
Development
Tickets
New Ticket
Search
Toggle Alerts Log
Help
6/24/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#7363] Avoid bitwise operations in the SQL Share driver
*
Your Email Address
*
Spam protection
Enter the letters below:
. ,. ..___. __. __ \./ |_/ _/ (__ / ` | | \./__..__)\__.
Comment
> > The attached patch optimizes the way we do the problematic slow > query. We have patched our production environment and our problem > seems to be definitively solved. Thanks god! > > We can do it because in our horde installation we don't allow sharing > anything with all the users (authenticated or not) - perm_creator, > perm_default and perm_guest will always be zero in our database > > We are changing the original LEFT JOIN with a UNION > > At the moment we ONLY change the query if the user is not part of any > group and if we don't have $attributes. It could be improved, but > this is enough for us. > > Original query: > SELECT DISTINCT s.* > FROM nag_shares s > LEFT JOIN nag_shares_users AS u ON u.share_id = s.share_id > WHERE s.share_owner = 'username' > OR (s.perm_creator & 2) > OR (s.perm_default & 2) > OR ( u.user_uid = 'username' AND (u.perm & 2)) > ORDER BY s.attribute_name ASC; > > Improved query (written by David Fernandez -sysadmin at the UPV/EHU- > based on the patch sent by John Madden to the kronolith mailing list: > SELECT DISTINCT s.* > FROM nag_shares s > WHERE s.share_owner = 'username' > UNION > SELECT s2.* > FROM nag_shares s2 RIGHT JOIN nag_shares_users u ON s2.share_id = u.share_id > WHERE ( u.user_uid = 'username' AND (u.perm & 2)) > > Comments are welcomed !
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers