AnsweredAssumed Answered

PHP API : Longer to load a large field instead of 10 smaller ones...

Question asked by Tommy_G on Aug 12, 2009
Latest reply on Apr 12, 2011 by TSBear

Summary

PHP API : Longer to load a large field instead of 10 smaller ones...

Description of the issue

I'm currently working on a web module for my company's new application and I need to get data from the database. On my layout, I have a field that has a lot of text(the equivalent of a 8-9 pages PDF). This field is in a portal that has 4 different block of information (basically all I need in 4 different languages). Now, as mostly everyone knows, the PHP API, when connected to a layout, will load EVERYTHING on the layout, regardless of if you use it or not on your PHP page. Since my PHP page shows 25 records at a time, that means it makes 25 queries to the database, each time loading those 4 big fields. I don't actually show those fields for the user, but they're necessary for search purposes. Anyway, when that field was added to the layout, my loading time when from instantaneous to taking between 20 and 25 seconds. After much testing, we found out that having 10 fields that each get a part of the information from the big field will give us a loading time of 1 to 2 seconds, making it WAAAAAAAAY faster. Is it normal for the API to struggle to load regular text from a field? In the end I'm actually loading the same amount of information, but the API as way more trouble loading 100 big fields(25 requests * 1 field * 4 languages) than loading 1000 small fields(25 requests * 10 fields * 4 languages) Tommy Gagnon

Outcomes