# Slow-loading form, is lazy loading possible?

**URL:** <https://forum.servoy.com/t/slow-loading-form-is-lazy-loading-possible/4575>\
**Category:** Classic Servoy\
**Created:** [August 4, 2005, 7:11pm UTC](https://forum.servoy.com/t/slow-loading-form-is-lazy-loading-possible/4575 "2005-08-04T19:11:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![swingman](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/swingman/32/4536_2.png) [@swingman](https://forum.servoy.com/u/swingman)\
**Post date:** [August 4, 2005, 7:11pm UTC](https://forum.servoy.com/t/slow-loading-form-is-lazy-loading-possible/4575/1 "2005-08-04T19:11:58Z")

</div>

Hi all,

- I have a table of newsletters with a complicated HTML preview.
- There is a newsletter form with a title field on it. On the form are two tabpanels showing one form each:

1. a google-style list panel showing 25 newsletter records at the time,
2. a detail panel showing the preview of the selected newsletter.

The two panels are unrelated to the base form, but because they are based on the same table and share the same foundset, they are all syncronized in what they display.

The problem is that it seems Servoy loads all the fields of all the forms for all 25 records, rather than just the one which are showing (I can jump between newsletters instantly, but going to the next 25 takes ages). Loading 25 newsletter previews is slow…

Any ideas for how to get around this?

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [August 4, 2005, 7:28pm UTC](https://forum.servoy.com/t/slow-loading-form-is-lazy-loading-possible/4575/2 "2005-08-04T19:28:39Z")

</div>

As far as I understand is that when you load a foundset it also loads the BLOB fields even when you don’t show them. Not sure if it’s a Servoy or a JDBC thing.  
This makes browsing thru a table with large (text) BLOB’s very slow.

I understand you have meta data and the HTML right ?  
Why not have a meta-data table and a seperate related HTML table.  
This way you should be able to browse thru the meta-data more quickly and load the large HTML when needed.

Admittedly this is in theory, I haven’t tested this yet but it makes sense ![:)]( "Smile") .

Hope this helps.

---

<div class="post-metadata">

**Author:** ![swingman](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/swingman/32/4536_2.png) [@swingman](https://forum.servoy.com/u/swingman)\
**Post date:** [August 4, 2005, 7:54pm UTC](https://forum.servoy.com/t/slow-loading-form-is-lazy-loading-possible/4575/3 "2005-08-04T19:54:11Z")

</div>

> ROCLASI:  
> As far as I understand is that when you load a foundset it also loads the BLOB fields even when you don’t show them. Not sure if it’s a Servoy or a JDBC thing.  
> This makes browsing thru a table with large (text) BLOB’s very slow.

The browsing is very quick, since all 25 records are loaded 😉 as long as you don’t want to go to record 26…  
Also the SQL query which generates the pks for the 25 records in the list is instant.

> ROCLASI:  
> I understand you have meta data and the HTML right ?  
> Why not have a meta-data table and a seperate related HTML table.  
> This way you should be able to browse thru the meta-data more quickly and load the large HTML when needed.

May have to try splitting the two…

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [August 5, 2005, 12:29pm UTC](https://forum.servoy.com/t/slow-loading-form-is-lazy-loading-possible/4575/4 "2005-08-05T12:29:53Z")

</div>

blobs/mediafields are not loaded directly to servoy. And we also don’t query them anymore in the normal row data select. So they shouldn’t be loaded when not needed. Only once.

So is it a MEDIA field where you have that html preview in?  
If you just have all string columns then yes everything will be loaded.

---

<div class="post-metadata">

**Author:** ![swingman](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/swingman/32/4536_2.png) [@swingman](https://forum.servoy.com/u/swingman)\
**Post date:** [August 7, 2005, 6:52am UTC](https://forum.servoy.com/t/slow-loading-form-is-lazy-loading-possible/4575/5 "2005-08-07T06:52:11Z")

</div>

Hi Johan,

> jcompagner:  
> So is it a MEDIA field where you have that html preview in?

They are strings…

I populate my list with a query like this

```auto
SELECT newslettersid FROM newsletters ORDER BY datepublished DESC LIMIT 25 OFFSET 0

```

which executes in no time… then Servoy does a

````auto
select newsletters.newslettersid, newsletters.datepublished, newsletters.newsletterpreview, newsletters.current_paragraphid, newsletters.headline, newsletters.intro, newsletters.emailpreview, newsletters.plaintextpreview, newsletters.newsletter_type from newsletters where newsletters.newslettersid in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
``` which takes about 6 seconds on average just to return from the mySQL database, although I'm only displaying 

newsletters.datepublished
newsletters.newsletter_type

in my form.

What will happen if I change the type of

newsletters.newsletterpreview
newsletters.plaintextpreview
newsletters.emailpreview

to media? can I still display them in HTML areas?
````
