[Tutor] data sharing
Wed Apr 16 21:38:02 2003
On Tue, 15 Apr 2003 firstname.lastname@example.org wrote:
> Hi pythonmania,
> Thanks for many advices you've given in my previous problem [list
> Now, StraightToProblem: I have an object "Class_A" that get a big data
> from MySQL to do search/sort etc. How can I share that data, so that if
> other object "Class_B", "Class_C" need the same data, they can use it,
> without have to call it from MySQL.
A tangent question: just to make sure, when you say "big data", do you
mean that the string in your database is huge, or do you mean that the
table itself has many rows that make searching for a row very slow?
If it's the latter, then you may want to check that your table is
If your tables are not indexed, adding an appropriate column index may
speed up your object construction dramatically. In some cases, it may
speed it so much that you may not need to worry so much about keeping
search results in memory.
Good luck to you!