Re: Minor Efficiency Question



In article <xn0eh4zzo1e8s4001@xxxxxxxxxxxxxxxxxxxxxxxxx>,
"Murdoc" <murdoc_0@xxxxxxxxxxx> wrote:

> Hi,
>
> I have had to write a utility to migrate some data in our application. Once
> of the things that I
> need to do is record a list of the records that need to be processed, then
> traverse that list and
> process them.
>
> E.g.
>
> define temp-table tt_products no-undo.
>
> for each Product
> no-lock:
>
> find first ProductLine
> where ProductLine.Product-ID eq Product.Product-ID
> no-lock
> no-error.
> if not available(ProductLine)
> do:
> /* Create a single record of the Product */
> end.
>
> end.
>
> There will be multiple for each ... end blocks, so a tt_products record can
> be created from any
> situation, but only one tt_products record is to be created
>
> Now, the Product table has a single-component unique index (ProductID). Would
> it be more or less
> efficient to store the rowid() of the record in the Product table rather than
> storing the ProductID
> value?
>
> Regards,


Well, you can store the ROWID in the product table... but realize upon a
dump and load you are NOT guaranteed to get the same ROWIDs for your
records. In fact, I can almost GUARANTEE your ROWIDs for the records
will be different. This could cause a little bit of storm in your data!

--
Available for Hire! http://amduus.com/Resumes/
.



Relevant Pages

  • Re: Minor Efficiency Question
    ... Scott Auge wrote: ... you can store the ROWID in the product table... ... I can almost GUARANTEE your ROWIDs for the records ...
    (comp.databases.progress)
  • Re: Minor Efficiency Question
    ... you can store the ROWID in the product table... ... I can almost GUARANTEE your ROWIDs for the records ... if it is the ROWIDs of a permanent table that are going into ...
    (comp.databases.progress)
  • Minor Efficiency Question
    ... There will be multiple for each ... ... the Product table has a single-component unique index. ... efficient to store the rowid() of the record in the Product table rather than storing the ProductID ...
    (comp.databases.progress)