Feature Wiki

Information about planned and released features

Tabs

Developer Guideline: Writing SQL queries efficiently

1 Description

The following grep
 
find -type f -name "*.php" -not -name "dbupdate*" -not -name "ilDBTemplate.php"  -exec grep -Hn -i -e "select.\+\*.\+from" {} \; | wc -l
 
results in 1487 matches (ILIAS 4.2.x).
 
Every maintainer should revise the sql queries of the services/modules he/she is responsible for. Maybe we should create a "Developer Guideline" for writing queries. Especially with an Oracle dbms selecting all columns (with *) is very expensive concerning the performance.

2 Status

  • Scheduled for Release: ILIAS 4.3
  • Funding: Not required
  • Development: Feature is to be developed by all

3 Additional Information

  • If you want to know more about this feature, its implementation or funding, please contact: Michael Jansen / mjansen [at] databay [dot] de

4 Discussion

JF 24 Oct 2011: We highly appreciate this. We would like to add this as a guideline in the developer guide. We also would like that all maintainers grep their components for these selects and reduce the fields read to a minimum.

5 Follow-Up

Last edited: 17. Apr 2025, 15:05, Kunkel, Matthias [mkunkel]