Subject | RE: [firebird-support] DB Design Question - include large blob in master table, or separate table |
---|---|
Author | Maya Opperman |
Post date | 2008-01-30T09:13:45Z |
Hi Martijn,
a- Start Transaction
b- update StockTable small fields
c- if New-Image-Selected then
update same StockTable record's blob field (in a separate SQL
statement)
d- Commit
I think line c- will create a lock conflict as the same record is being
updated twice within the same transaction?
(And merging it into one update is not going to be easy as I have a
middle layer that constructs the update SQL automagically, so I'd rather
try to not have to go that route if at all possible)
but regarding the update issue, good or bad idea?
Or, in your experience, is the speed of updating say a 1MB image in a
blob negligible?
Thanks
Maya
>>Locking issues? Do you expect multiple people to run the sameNope, I was worried about: (pseudo code)
>>UPDATE statement against the record?
a- Start Transaction
b- update StockTable small fields
c- if New-Image-Selected then
update same StockTable record's blob field (in a separate SQL
statement)
d- Commit
I think line c- will create a lock conflict as the same record is being
updated twice within the same transaction?
(And merging it into one update is not going to be easy as I have a
middle layer that constructs the update SQL automagically, so I'd rather
try to not have to go that route if at all possible)
>>SELECT * FROM ... is a big no-no. Better get that fixed :-)OK, so agreed, your DB design shouldn't try to compensate for bad SQL,
but regarding the update issue, good or bad idea?
Or, in your experience, is the speed of updating say a 1MB image in a
blob negligible?
Thanks
Maya