6 Replies Latest reply on Aug 21, 2009 10:22 AM by Tommy_G

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

    Tommy_G

      Title

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

      Post

      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.

       

      Now I'm wondering if it's 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).

       

      Should I report this as a bug of the API? If it's not a bug can I know why the API is insanely slow when it needs to load 100 big fields instead of 1000 smaller ones?

       

      Thank you!

       

      Tommy Gagnon