| View previous topic :: View next topic |
| Author |
Message |
Marcos Guest
|
Posted: Thu Dec 02, 2004 10:16 pm Post subject: OPF Paging List |
|
|
I have been using some opf and all of them has two way to return data:
1 - an object list returns
2 - an object list returns based on a criterion
In spite of second to be better, when the list of data is big exists
always an overhead for bring their and sometimes causing lack of memory
(this is a largest problem).
I also worked with Datasnap and I noticed the advantages of having an
application StateLess.
How can I work in the same way in an OPF?
I read that Joanna has a Paging List. Will it be that she could explain
better how this pagination works?
Thanks a lot!
|
|
| Back to top |
|
 |
Joanna Carter (TeamB) Guest
|
Posted: Thu Dec 02, 2004 11:14 pm Post subject: Re: OPF Paging List |
|
|
"Marcos" <mrbar2000 (AT) yahoo (DOT) com.br> a écrit dans le message de news:
[email]41af9429 (AT) newsgroups (DOT) borland.com[/email]...
| Quote: | I read that Joanna has a Paging List. Will it be that she could explain
better how this pagination works?
|
My paged list eventualy pulls in the whole collection as the user pages
through the list GUI.
Of course, the problem is if the user does Ctrl-End, in which case you
either end up with a delay while the list catches up, or you can reverse the
underlying query and start filling from the end of the list.
Joanna
--
Joanna Carter (TeamB)
Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker
|
|
| Back to top |
|
 |
Marcos Guest
|
Posted: Thu Dec 02, 2004 11:53 pm Post subject: Re: OPF Paging List |
|
|
| Quote: | My paged list eventualy pulls in the whole collection as the user pages
through the list GUI.
Of course, the problem is if the user does Ctrl-End, in which case you
either end up with a delay while the list catches up, or you can reverse the
underlying query and start filling from the end of the list.
|
Ok, but while your list isn't filled your query stay open with data?
This not duplicate the data in memory?
thanks
|
|
| Back to top |
|
 |
Joanna Carter (TeamB) Guest
|
Posted: Fri Dec 03, 2004 12:25 am Post subject: Re: OPF Paging List |
|
|
"Marcos" <mrbar2000 (AT) yahoo (DOT) com.br> a écrit dans le message de news:
[email]41afab11 (AT) newsgroups (DOT) borland.com[/email]...
| Quote: | Ok, but while your list isn't filled your query stay open with data?
This not duplicate the data in memory?
|
The only other way would be to run a query that only returns the OIDs into
an array or something and then uses the OIDs in theat array to fire off
single row queries as the list/grid requires, looking up the OID based on
the index of the row in the list/grid as found in the array.
Joanna
--
Joanna Carter (TeamB)
Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker
|
|
| Back to top |
|
 |
Jim Cooper Guest
|
Posted: Fri Dec 03, 2004 1:58 am Post subject: Re: OPF Paging List |
|
|
| Quote: | The only other way would be to run a query that only returns the OIDs
|
Or the OIDs and enough data to show in the list (typically ths is small)
Cheers,
Jim Cooper
_______________________________________________
Jim Cooper [email]jim (AT) falafelsoft (DOT) com[/email]
Falafel Software http://www.falafelsoft.com
_______________________________________________
|
|
| Back to top |
|
 |
Marcos Guest
|
Posted: Fri Dec 03, 2004 5:06 am Post subject: Re: OPF Paging List |
|
|
| Quote: | Ok, but while your list isn't filled your query stay open with data?
This not duplicate the data in memory?
The only other way would be to run a query that only returns the OIDs into
an array or something and then uses the OIDs in theat array to fire off
single row queries as the list/grid requires, looking up the OID based on
the index of the row in the list/grid as found in the array.
|
Very thanks JC.
And as to bring the data of form stateless as we do when using Datasnap?
I have 300 records into TableA. I have open the list of 300 objects in
that table but I want retrieve only 30 records per time. The Server
don't hold the start or end record fetched Client. The client should
produce this information. I have curios how can us implement this into
our opf!!!
I am impressed with his/her answer speed Joanna. Very grateful!
|
|
| Back to top |
|
 |
Marcos Guest
|
Posted: Fri Dec 03, 2004 6:48 am Post subject: Re: OPF Paging List |
|
|
| Quote: | Ok, but while your list isn't filled your query stay open with data?
This not duplicate the data in memory?
The only other way would be to run a query that only returns the OIDs
into an array or something and then uses the OIDs in theat array to
fire off single row queries as the list/grid requires, looking up the
OID based on the index of the row in the list/grid as found in the
array.
|
Very thanks JC and Jim.
And as to bring the data of form stateless as we do when using Datasnap?
I have 300 records into TableA. I have open the list of 300 objects in
that table but I want retrieve only 30 records per time. The Server
don't hold the start or end record fetched Client. The client should
produce this information. I have curios how can us implement this into
our opf!!!
I'm impressed with your fast answer. Very grateful!
|
|
| Back to top |
|
 |
Roman Kaßebaum Guest
|
Posted: Fri Dec 03, 2004 8:17 am Post subject: Re: OPF Paging List |
|
|
Joanna Carter (TeamB) schrieb:
| Quote: | The only other way would be to run a query that only returns the OIDs into
an array or something and then uses the OIDs in theat array to fire off
single row queries as the list/grid requires, looking up the OID based on
the index of the row in the list/grid as found in the array.
|
Single row queries are very very slow.
--
Roman
|
|
| Back to top |
|
 |
Roman Kaßebaum Guest
|
Posted: Fri Dec 03, 2004 8:20 am Post subject: Re: OPF Paging List |
|
|
Marcos schrieb:
| Quote: | I have 300 records into TableA. I have open the list of 300 objects in
that table but I want retrieve only 30 records per time.
|
In some special cases we create more than 30000 objects.
There is no problem of memory usage.
By the way objects are much more faster than queries.
--
Roman
|
|
| Back to top |
|
 |
Joanna Carter (TeamB) Guest
|
Posted: Fri Dec 03, 2004 8:30 am Post subject: Re: OPF Paging List |
|
|
"Roman Kaßebaum" <roman.kassebaumnospam (AT) kdv-dt (DOT) de> a écrit dans le message
de news: [email]41b02078 (AT) newsgroups (DOT) borland.com[/email]...
| Quote: | Single row queries are very very slow.
|
That has not been my experience when the query is based on an indexed single
integer column.
i.e. SELECT * FROM customer WHERE id = 123456
Joanna
--
Joanna Carter (TeamB)
Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker
|
|
| Back to top |
|
 |
Joanna Carter (TeamB) Guest
|
Posted: Fri Dec 03, 2004 8:37 am Post subject: Re: OPF Paging List |
|
|
"Marcos" <mrbar2000 (AT) yahoo (DOT) com.br> a écrit dans le message de news:
[email]41b00c4d (AT) newsgroups (DOT) borland.com[/email]...
| Quote: | I have 300 records into TableA. I have open the list of 300 objects in
that table but I want retrieve only 30 records per time. The Server
don't hold the start or end record fetched Client. The client should
produce this information. I have curios how can us implement this into
our opf!!!
|
The problem with 'dropping' the early records as you pass through the list
is that most SQL cursors are unidirectional, therefore you can't get back to
earlier records once you have past them.
Therefore most dataset components tend to keep all records in memory once
they have been read. Overall the efficiencies are greater doing it that way
than worrying about memory usage on a Windows OS which allows you 2GB of
memory for a process.
Anywhere up to a couple of million objects is quite acceptable, although I
tend to design my UI to encourage users never to ask for more than a hundred
or so objects. I refuse to believe that any user can ever need to browse
through that many records without knowing something about the objects they
are looking for.
Joanna
--
Joanna Carter (TeamB)
Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker
|
|
| Back to top |
|
 |
Lee_Nover Guest
|
Posted: Fri Dec 03, 2004 8:43 am Post subject: Re: OPF Paging List |
|
|
| Quote: | Single row queries are very very slow.
That has not been my experience when the query is based on an indexed
single
integer column.
i.e. SELECT * FROM customer WHERE id = 123456
|
I agree with Roman
one select with multiple records eg: .. WHERE ID IN (1, 2, 3, 4, 5, 6)
is much faster than a: for I:=1 to 6 do FetchWhere('ID', fwEquals, I);
|
|
| Back to top |
|
 |
Lee_Nover Guest
|
Posted: Fri Dec 03, 2004 8:47 am Post subject: Re: OPF Paging List |
|
|
| Quote: | By the way objects are much more faster than queries.
|
did some caching to speed things up .. instead of 7secs to fetch the data
now only a few ms is needed
even if you have a class that takes up 100bytes .. with 1M records that's
still _only_ 100MB memory .. which for servers shouldn't be much
|
|
| Back to top |
|
 |
Roman Kaßebaum Guest
|
Posted: Fri Dec 03, 2004 9:20 am Post subject: Re: OPF Paging List |
|
|
Joanna Carter (TeamB) schrieb:
| Quote: | That has not been my experience when the query is based on an indexed single
integer column.
i.e. SELECT * FROM customer WHERE id = 123456
|
But that has been my experience.
In my example I have a simple loop for every object where I use a
property, e. g.:
for i := 0 to pList.Count - 1 do
pList[iCount].Name := IntToStr(i);
I tried two things:
First I had a list of ID, so that for every object I'll fire
'select * from Table where ID = ObjectId'.
Second I tried 'select * from table'. After that I filled the objects
from the query, e.g.:
while not pQuery.Eof do
begin
ObjectById(pIdField.AsInteger).LoadFromDataSet(pQuery);
pQuery.Next;
end;
After that I called the loop.
The second example is much more faster than the first one.
--
Roman
|
|
| Back to top |
|
 |
Jim Cooper Guest
|
Posted: Fri Dec 03, 2004 11:02 am Post subject: Re: OPF Paging List |
|
|
| Quote: | Single row queries are very very slow.
|
So you don't call them in big loops. Typically you have a list of some
sort showing basic info (all gotten with one query), and detailed info
is only requested as required (eg when an editing form is displayed).
Sometimes it pays to be a little judicious when scrolling though a long
list and only load objects when scrolling stops.
Cheers,
Jim Cooper
_______________________________________________
Jim Cooper [email]jim (AT) falafelsoft (DOT) com[/email]
Falafel Software http://www.falafelsoft.com
_______________________________________________
|
|
| Back to top |
|
 |
|