What is best approach instead of DB lookup? #6136
Replies: 3 comments 5 replies
-
|
Have you looked at the merge join transform? Also: DB Lookup can be fast if you enable caching, but caching requires memory. |
Beta Was this translation helpful? Give feedback.
-
|
IMHO the approach should be chosen considering a variety of factors (number of records of each table, record length, growth rate, available resources, ...). For example, if you have 2.8 millions rows but the record length and the growth are very limited you could bring in all rows. BTW the database lookup should be a good option, if it is taking humongous time probably there is no index suitable for the search. Sometimes there is an index that seems good but for some reasons the query optimizer is not using it. In many cases, It is useful to check the query plan. If database lookup is very slow, also other strategies could result in poor performances. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks bamaer and liosc but i have other pipeline where i do need all multiple records and then make it into list and then place at once so that primary key of first entity will go same as field in second Entity eg: A.ActivationId == B.Activation I think hop doesn't allow two Table input transform in one pipeline, if it had we could have query in second table input with ActivationId coming from first table Input transform. I was migrating these two entities separately, but source system primary key is of GUID(eg: 163D24B4-88FC-E811-9F80-000C2979F806) type, with guid we cant scale in destination system Hence two entities have to be handled in single pipeline to place primary Key same in other field of second Entity. since these Entity's are huge. Any ideas to solve this? |
Beta Was this translation helpful? Give feedback.



Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have two Entities which one-to-many relation in mssql server
Entity A - Fields(id, age, gender, ActivationId, ... etc)
Entity B - Fields(id, Activation ,....etc)
so A.ActivationId == B.Activation
Entity B can have multiple records with same ActivationId
Earlier I was using DB lookup for Entity B with ActivationId came from response of query of InputTable of A.
DB lookup gets the top one record(thats fine for me) but it taking humongous time i have almost 2.8 million records, Hence i had to switch to incorporate in Input Query Itself with left join but later realized multiple rows from Entity B makes new record in destination. so count is not matched from source to destination.
Eg: LEFT JOIN QUERY
accIdn.idType, accIdn.idNumber, accIdn.expiryDate are newly placed in query
SELECT
// other fields of acc and con table
, accIdn.idType as AccIdentificationType
, accIdn.idNumber as AccIdentificationNumber
, accIdn.expiryDate as AccIdentificationexpiryDate
FROM ACCOUNT acc
LEFT JOIN XCONTACT con ON con.account = acc.BAN and con.type_=1
LEFT JOIN AccountIdentification accIdn on accIdn.BAN = acc.BAN
WHERE acc.spid = 410
AND acc.state != 2
AND acc.systemType !=0
AND (acc.parentBAN = '' OR acc.parentBAN IS NULL)
ORDER BY
acc.BAN
what is the best way to handle multiple records of Entity B? is it from query or other transform etc?
Any help is appreciated.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions