Categories > TinyButStrong general >

Working with large datasets

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Whitlark
Date: 2005-03-10
Time: 20:23

Working with large datasets

I am planning on using TinyButStrong. My question is this. I am doing a mysql query and that query returns over 1,000 rows. Any tips or tricks I should think about when using TinyButStrong?
By: Skrol29
Date: 2005-03-11
Time: 01:20

Re: Working with large datasets

Hi Whitlark,

I usually test the TBS beta versions using a MySQL table with 5 fields and 1000 rows, merged to a block with a date format, and alternative display. It takes 1.12 seconds.

If you want to save time execution, then don't use the ByPage mode, just make your own display by page using the LIMIT clause of MySQL.

Parameters 'select', 'if', 'then', 'else'  and 'where' cost time execution when they are used in a block merged with lot of data.

Otherwise, you can also save time using the Cache System.
By: Whitlark
Date: 2005-03-11
Time: 01:45

Re: Working with large datasets

Does it store all those rows in memory for the merge? Another issues is that I only have 8mb allocated for php. My webhost's limitation, if a php script tries to allocate more than 8mb it errors.
By: Skrol29
Date: 2005-03-11
Time: 02:03

Re: Working with large datasets

Hi,

No, TBS doesn't store the rows in a table. Only in the very special case when you whant to feed several blocks with the same query.
TBS doesn't store rows, but it stores the full contents of the page before to display it. My test page with 1000 rows is 112 kb.

by the way, I'm working on a feature to make TBS able to display on the fly when merging. It will maybe be available for TBS 2.02

By: Whitlark
Date: 2005-03-11
Time: 02:04

Re: Working with large datasets

Excellent! Thankyou for answering my questions!
By: george
Date: 2005-07-03
Time: 17:39

Re: Working with large datasets

I didn't understand this very well. If tbs doesn't use LIMIT then it grabs the whole recordset and displays only the ones needed. This isn't very efficient. Or am I wrong?
By: Skrol29
Date: 2005-07-04
Time: 00:52

Re: Working with large datasets

> This isn't very efficient. Or am I wrong?

You're rigth, it is not efficient when pages to display are numerous. There is a warning in the manual about that.
The point is if TBS manages the By Page Mode by inserting a LIMIT clause, then this brings two problems:
1/ Only SELECT queries become available and without LIMIT clause, and TBS has to check that.
2/  The By Page Mode will not work for other databases system.

By Page Mode is for a number of pages lower than 10 (about).
Over this number, the programer should optimize its code by managing itself the query in order to retreive the range of data of a certain page.
For MySQL, this means to insert the LIMIT clause inside the query.