Re: Questions about Online vs SE
Posted in 1993
In article <C3n8DG.K8E@world.std.com> smayo@world.std.com (Scott A Mayo) writes: >If the maintainence *is* significantly more complicated, does >anyone have experience in reliably faking blobs in >Informix/SE? I'd be interested in hearing an answer to this one, too. In ESQL/C, two implementations immediately spring to mind: 1) Instead of a blob, have a serial column, and generate a file name based on the serial column. Store the blob data in that file. This would work OK if there weren't too many records with small blobs in the database. One might want to implement a hierarchical directory structure if there were a lot of records, especially on a system that doesn't keep directories as hash tables. 2) Make a big data file to hold the blobs, and do dynamic space management somehow (perhaps with something as simple as a free list that's searched when something is added). To do it right, one would have to deal with fragmentation, etc. The offset within the file of the blob could be stored in a integer in the database. Both of these would be relatively difficult, and they have another big disadvantage: A blob isn't deleted automatically when the record that points to it is deleted. One would either have to be _very_ careful to call some kind of "delete_blob" function whenever something is deleted, or do garbage collection (blech!). If you're lucky enough to be on a system with triggers, they might handle this -- Can one define a trigger that executes an arbitrary executable (i.e. a C program) with some reasonable command-line arguments indicating database, record, and perhaps a value within the record? -- Bill Foote bill@pds.com PDS Corp, Los Angeles, CA USA uunet!promdist!bill