I am not sure what you mean.
Are you saying that when python sorts the data on the client verse the
database query sorts the data on the db server you can lose data?
No, I mean when python is sorting on a small list from DB,
you'll "loose" (won't see) rows as you're working on a window and
not on the whole DB.
Imagine you have a spreadsheet with some columns and 30,000 lines,
it is sorted on the 1st column: cliNb (an integer).
If you go anywhere into the list and re-sort only a small
amount of lines, lets say lines: cliNb=[500-600], but this
time on familyName.
You now have holes in your window of sort, because for example
cliNb=1 has a familyName that should be appear this window.
Can you explain why it's mandatory and how do you get holes in the
list. I ask because I have not heard of this.
This is what I do:
* I set total Nb of rows to "SELECT count(*) FROM mytable", lets say
it is 1,500,000 (so my VRULE reflect the real size of the table)
* I read a small sorted list of rows from mytable (~400 rows) in
cache
* When the vovl ask for rowItem (list index), I do several things:
*Is rowItem cached?
*YES: Am I at the beginning of the list?
*YES: *continue
*NO: *shift rowItem to have a correspondance with the cache
index (ie: rowItem=45,247 => cacheIdx=204)
*NO: *Calculate beginning|end of cache offset
*Fill cache from DB
*Return a Storage object containing all columns values
So, for the reason above, even if rowItem is cached but the
sorting column has changed, I issue a new DB query with the new
order.
I must say that python have some drawbacks I don't like that makes it
unpleasant to work with: asserting that None = False (really, who
made THIS?!), or the lack of switch/case, or far worse: the fact
that a pgm written 1.5 years ago don't work anymore because of
internal changes - so I'll finish and debug my actual project, and
rewrite it into, may be Erlang, as I just discovered wx is ported
under this language (LUA isn't possible as virtual functions aren't
ported:(
···
On Mon, 28 Nov 2011 16:50:03 -0500 Dev Player <devplayer@gmail.com> wrote:
--
A woman takes off her claim to respect along with her garments.
-- Herodotus