Subject | Re: Firebird 1 |
---|---|
Author | ft@cluedup.com |
Post date | 2001-06-01T16:01:52Z |
--- In IBDI@y..., "Jason Wharton" <jwharton@i...> wrote:
use linked lists instead and iterate through the list from the
beginning to fetch the Nth element?
subset of the data on the table we use SELECT * FROM THETABLE then
process the dataset to choose the rows that we really need and sort
them according to any complex criteria?
bookmarks for all the records that would come after the deleted
record in all the ordered views that we use in our application and
update the auxiliary fields that we have added to our tables for this
purpose? If we add new views of data in the future, we add new
auxiliary fields to the tables as needed? Of course our database is
not normalised and we are not joining three or four tables in a query.
does when viewing the message index in a Yahoo group such as this to
see the list of the more recent messages)? Programmers shouldn't be
trusted to choose the right tools for the job?
application? ROWNUM is simply the index within a dataset and has its
uses as other posters have described. You have mentioned one possible
misuse of fetching subsets of a dataset. David Jencks pointed out in
the follow-up to your message that the programmer should not rely on
a sorting order decided by the RDBM. This can always be avoided with
a "safety net" ORDER BY clause on a unique field.
My problem with your approach is you underestimate the complexity of
writing and maintaining middleware. You maintain that transactions
are a desirable feature for an RDBM when it is possible to write
transactional middleware without the RDBM supporting transactions.
The same logic applies to user requests for selective fetching of
rows. Most web sites need only lightweight session objects (if any)
for authentication purposes. The amount of memory and processing
resources used by middleware is not less than what would be needed if
the database had to do a lot of extra work.
Partial query results, alongside case-independent sorting of results,
is a must-have for wide deployment of any RDBM on the web. If it
cannot be achieved with the available human resources, it's no ones
fault. But certainly users should not face gratuitous name-calling
for demanding it.
Fred Toussi
> All this talk about the server delivering portions of a datasetbased on
> ROWNUM ranges is nauseating.Are arrays that are accessed by indexes nauseating too? Should one
use linked lists instead and iterate through the list from the
beginning to fetch the Nth element?
> AFAIK, InterBase/Firebird does not have the concept of a row numberon the
> server. This belongs on a client that is actually fetching data andcounting
> rows as it goes and keeping them in a cache of its own. The servershould
> not be required to keep hordes of caches around just to spit outsmall
> slices of datasets efficiently. Nor should it be made to re-executequeries
> over and over again just to increment through data.So only tables are needed for safe storage of data? If we need only a
subset of the data on the table we use SELECT * FROM THETABLE then
process the dataset to choose the rows that we really need and sort
them according to any complex criteria?
> What should be happening is using bookmarks derived from meaningfuldata in
> your table that allows the server to quickly pull records from thenext
> segment and then it just brings back rows until you don't want anymore.
> When you want more records you somehow say, this is the newstarting point
> and I want some more records starting from there.Interbase/Firebird handles
> that very well. IBO even automates with its various searchingfacilities.
>So each time one record is deleted form the table, we recalculate the
bookmarks for all the records that would come after the deleted
record in all the ordered views that we use in our application and
update the auxiliary fields that we have added to our tables for this
purpose? If we add new views of data in the future, we add new
auxiliary fields to the tables as needed? Of course our database is
not normalised and we are not joining three or four tables in a query.
> By doing it this way you are able to walk a batch of records morerelative at
> accurately. Row Nums are potentially inaccurate. They are always
> best.they are
>
> e.g. Someone is browsing a web site and they see recs 1-50, while
> doing that one of the records they are looking at becomes deletedand then
> when they page to rows 51-100 the record that used to be 51 is now50 and
> guess what, they never see that record. If instead their requestfor more
> records was based on records after the value for record 50 theywould pick
> up that record and not miss it. using a snapshot transaction isdefinitely
> not a solution to this problem either.What if he typically starts by browsing record 2900 or so (as one
does when viewing the message index in a Yahoo group such as this to
see the list of the more recent messages)? Programmers shouldn't be
trusted to choose the right tools for the job?
> ROWNUM is simply for lazy programmers who don't really care if theirengine even
> applications work 100%. I vote for them to be banished from the
> if any such semantics are already there. This part of thecomplexity should
> be solved on a middle tier or client. A server's job is to dotransactions,
> optimize whatever queries I throw at it and keep data integrity.stored
>
> I suppose if you really want them it is a snap to write select
> procedures that provide a row num facility...Are intrepid programmers supposed to reinvent the wheel for each new
application? ROWNUM is simply the index within a dataset and has its
uses as other posters have described. You have mentioned one possible
misuse of fetching subsets of a dataset. David Jencks pointed out in
the follow-up to your message that the programmer should not rely on
a sorting order decided by the RDBM. This can always be avoided with
a "safety net" ORDER BY clause on a unique field.
My problem with your approach is you underestimate the complexity of
writing and maintaining middleware. You maintain that transactions
are a desirable feature for an RDBM when it is possible to write
transactional middleware without the RDBM supporting transactions.
The same logic applies to user requests for selective fetching of
rows. Most web sites need only lightweight session objects (if any)
for authentication purposes. The amount of memory and processing
resources used by middleware is not less than what would be needed if
the database had to do a lot of extra work.
Partial query results, alongside case-independent sorting of results,
is a must-have for wide deployment of any RDBM on the web. If it
cannot be achieved with the available human resources, it's no ones
fault. But certainly users should not face gratuitous name-calling
for demanding it.
Fred Toussi