Re: Performance Advice - Master/Detail Select
Date: 1997/06/02
Message-ID: <1997Jun2.100905.40896_at_ludens>#1/1
Hi
In article <01bc67bc$9d884f80$1e01070a_at_Donna.ci.portsmouth.va.us>, "Donna Morrow" <morrowd_at_ci.portsmouth.va.us> writes:
> Hi everyone! --- Need some opinions
>
> Design is thus:
> Master record m1
> Detail records d1
>
> I frequently need to access the most recent (i.e. maximum seq no) detail
> record for a specified master record. I need to retrieve several columns
> which store date and balance amounts in order to calculate the balances of
> the next detail record.
>
> Is there an efficient way of doing this in one SQL statement or would I be
> better to duplicate these balance amounts in the master record?
have an additional logical (char(1)) field in the detail table the most
recent records having a value in it (eg. 'X') the others having NULLs and
of cource create an index (masterid + this additional field)
OR
have a pointer (id) in the master record to the most recent child
>
> Looking for Guidance
>
> Donna
HTH
peter
Received on Mon Jun 02 1997 - 00:00:00 CEST