Re: The Zen nature of a Delphi database application



"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


.



Relevant Pages

  • Importing from 2 seperate Excell tables with some common and uncommon columns
    ... add all of the uncommon fields to it. ... For 2 or 3 create an Update query that populates all the ... based on one or more common fields. ... database, and the uncommon columns will be new fields. ...
    (microsoft.public.access.externaldata)
  • Re: Could not determine which columns uniquely identify the rows for (a table)
    ... The query I used in the wizard was; ... the only common link I could find was that the column ... It can however create the selects no matter what. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Delete query help
    ... It sounds as if you need three queries: an append query that joins the ... two shift tables and writes the common records to the common table, ... The first delete query would join the common table and one shift ...
    (microsoft.public.access.queries)
  • Re: Find Merge Datasource
    ... > common for a query to be deleted, but rather that the data source set in the ... And complaints are common. ... FWIW, Word doesn't store the SQL from a Query. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Database relationships design
    ... You would need SOME sort of primary key: you must have a "handle" to uniquely ... one relationship rather than the more common one to many. ... primary key as well - a Long Integer field if the master table primary key is ... Technology ...
    (microsoft.public.access.tablesdbdesign)