Start ::
Developers Corner ::
Module Development ::
pnmodvars - max size
Moderated by: Support Team
-
- rank:
-
Professional
- registered:
- December 2002
- Status:
- offline
- last visit:
- 24.08.08
- Posts:
- 1588
HI there,
I was just wondering what the recommended max size of a pnmodvar (the ones you create with pnmodsetvar) should be. I ask this becaue I have a module that stores a (serialised) config array as a modvar which could potentially become quite large... I have already noticed some overhead increase as the array beomes larger (not a lot, but noticable) - could this have adverse effects?
-Lobos
-----
-Lobos
Professional PHP Framework Services: Concept, Development and Deployment -
- rank:
-
Steering Committee
- registered:
- January 2003
- Status:
- offline
- last visit:
- 29.09.08
- Posts:
- 563
Since the value column for module variables is of type LONGTEXT, you should be able to store 64KB of text in it (which should be enough unless you have a really huge array).
In terms of overhead, this will certainly add some, however it's probably faster to do retrieve/update this in a single select/update rather than <n> (for however many elements you have) selects/updates. When in doubt, benchmark.
An alternative might be to serialize your array using delimeters (for example, "|") since this will shorted the amount of space required for the serialized array. However, this will only work for simple (1-dimensional) arrays and will require some custom code for (de)serialization ...
Greetings
--> R</n> -
- rank:
-
Professional
- registered:
- January 2004
- Status:
- offline
- last visit:
- 22.03.06
- Posts:
- 958
<smart ass="ass" remark="remark">
From: http://dev.mysq...verview.html
I doubt that anyone would want to store anything that big in a modvar but it *is* possible.
</smart> -
- rank:
-
Professional
- registered:
- March 2003
- Status:
- offline
- last visit:
- 14.08.06
- Posts:
- 1185
<smart ass="ass" remark="remark" redeux="redeux">
What if all modules had similar large vars? Might make more sense to consider other ways of storing your module's variables.
</smart>
Start ::
Developers Corner ::
Module Development ::
pnmodvars - max size
