Re: The Zen nature of a Delphi database application
- From: "Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx>
- Date: Sun, 18 Feb 2007 23:49:53 +0100
"marek jedlinski" <marekjed@xxxxxxxxxxxxxxxxx> wrote in message
news:jatgt2hh7ro77barvjld2fnvfcpnf8ieb8@xxxxxxxxxx
[...]
What I am worried about - perhaps needlessly - is performance. I
planned to use your third method: one table with all that is common
to all classes, and one additional table per concrete class. This
means that to read a complete record I need a SELECT...WHERE query
on the "concrete" table, keyed on the object's UID. Assuming that
objects are lazy-loaded and that the table has an index on the UID
field, will this cause a noticeable delay?
If it does, something's wrong. Even if the object is deeply derived
and need to join several tables together, it's still a fetch of a
single record by primary key - perhaps from more than one table, but
that difference is only linear in the number of tables in any case.
A single-record fetch by a known primary key should never take more
than logarithmical time, logarithmical in the number of records in
the table. All it needs is an index on every primary or foreign key,
and a database engine that knows how to avoid unnecessary work.
What about displaying a list of all records that way, say a
thousand of them?
On the one hand - how fast can you read a thousand records? How long
could you possibly make it take the computer? Why would you do this
preemptively, load more than a screenfull, if it worries you how long
it would take?
On the other hand - the caption by which to display an object should
ideally be in the common table. That way, you're sure that you can
generate the list from a single query. The time taken by a query is
not affected much by the number of records it returns.
Groetjes,
Maarten Wiltink
.
- References:
- The Zen nature of a Delphi database application
- From: marek jedlinski
- Re: The Zen nature of a Delphi database application
- From: Bjørge
- Re: The Zen nature of a Delphi database application
- From: marek jedlinski
- Re: The Zen nature of a Delphi database application
- From: Maarten Wiltink
- Re: The Zen nature of a Delphi database application
- From: marek jedlinski
- The Zen nature of a Delphi database application
- Prev by Date: Re: Editor component
- Next by Date: attn: jana - comforting downloads - eb - (1/1)
- Previous by thread: Re: The Zen nature of a Delphi database application
- Next by thread: Re: The Zen nature of a Delphi database application
- Index(es):
Relevant Pages
|