6.0.0-alpha10
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
5/18/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#6198] One loop less
*
Your Email Address
*
Spam protection
Enter the letters below:
.__.. ..__..___.. . | |\ /| | | |\ | |__\ \/ |__| | | \|
Comment
>>> - Don't use SELECT * > >> > >> What's the rationale for this? In this case we actually do want all > >> the columns. Is there a performance issue with '*' vs putting all the > >> column names in the query explicitly? > > > > One step less, some servers tends to access table headers to read > column list before processing the request. > > > >> > >>> - Combine the fetchAll db driver with the loop that creates > >>> galleries objects > >> > >> I don't see how this is reducing the number of loops, your just > >> replacing a for loop for a while loop from what I can tell. Also, > >> with your change we're no longer catching any errors that the > >> ->fetchAll() (->fetchRow() in your version) call can return. > > > > The first loop is the fetchAll, the second create objects. With while > you fetch the result and create the object in one loop. If you wish, > the row variable can be checked for errors, but is not needed as the > statement is executed and checked before. With a little renaming of > table columns the parameters replace loop could be replace either. > for example the gallery_desc becomes gallers_description and you can > select columns with "AS" sql alias inside select statement. Reducing > the attribute selection only to one loop. Now the are 3, not needed.
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