Discussion:
memo overhead
(too old to reply)
NigelGomm
2006-02-09 17:57:03 UTC
Permalink
I have a table with 3 fields, : one int and 2 binary memo fields.

the 2 memo fields hold a JPEG and ppt file for each record.

if i scan a test table with 33 records and copy the files out the sum total
of the file sizes is about 4.5mb.

But the fpt file is 7.6Mb (packed). That's more overhead than i was
expecting.

Any thoughts or suggestions?

tia

Nigel
Lee Mitchell
2006-02-09 22:06:37 UTC
Permalink
Hi Nigel:

Do you need to store the images in a memo file? Could you simply store the
images on disk as PPT or JPG files and then point to the file using a path
stored in a Vchar or character field?

I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 HAS ARRIVED!! --*
Read about all the new features of VFP9 here:
http://msdn.microsoft.com/vfoxpro/

*--Purchase VFP 9.0 here:
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/gp/lifeselectindex
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by NigelGomm
I have a table with 3 fields, : one int and 2 binary memo fields.
the 2 memo fields hold a JPEG and ppt file for each record.
if i scan a test table with 33 records and copy the files out the sum total
of the file sizes is about 4.5mb.
But the fpt file is 7.6Mb (packed). That's more overhead than i was
expecting.
Any thoughts or suggestions?
tia
Nigel
NigelGomm
2006-02-10 03:37:04 UTC
Permalink
Lee,

I did think about doing it that way but went for the memo field instead for
2 reasons.

1. The next major iteration of this app will have the option to use SQL
server or MySQL as backend databases. The intention is that the
screens&business classes won't know the difference (that's the theory
anyway).
2. Performance. Users will often check for duplicates which i do by
comparing (and GROUP BY) a sys(2007) of the memo fields. Also I did some
testing and (IIRC) displaying images in a grid was faster using the
pictureval property from a memo field over the picture property and a file.
3. I don't want nosy users/admin people deleting the files outside of my
application.

thanks

Nigel
Post by Lee Mitchell
Do you need to store the images in a memo file? Could you simply store the
images on disk as PPT or JPG files and then point to the file using a path
stored in a Vchar or character field?
I hope this helps.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell
*-- VFP9 HAS ARRIVED!! --*
http://msdn.microsoft.com/vfoxpro/
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr
http://support.microsoft.com/gp/lifeselectindex
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by NigelGomm
I have a table with 3 fields, : one int and 2 binary memo fields.
the 2 memo fields hold a JPEG and ppt file for each record.
if i scan a test table with 33 records and copy the files out the sum
total
Post by NigelGomm
of the file sizes is about 4.5mb.
But the fpt file is 7.6Mb (packed). That's more overhead than i was
expecting.
Any thoughts or suggestions?
tia
Nigel
Rick Bean
2006-02-09 23:28:54 UTC
Permalink
Nigel,
Consider changing the BLOCKSIZE (see SET BLOCKSIZE in help). You can use
SYS(2012) to check the current size. Remember that if you change the data in
these fields often, then you'll need to PACK MEMO on occassion otherwise the
.FPT will grow larger more quickly.

Rick
Post by NigelGomm
I have a table with 3 fields, : one int and 2 binary memo fields.
the 2 memo fields hold a JPEG and ppt file for each record.
if i scan a test table with 33 records and copy the files out the sum total of
the file sizes is about 4.5mb.
But the fpt file is 7.6Mb (packed). That's more overhead than i was expecting.
Any thoughts or suggestions?
tia
Nigel
Cindy Winegarden
2006-02-10 02:41:13 UTC
Permalink
Just to add, the reason for this is because whenever you change a memo
field's contents FoxPro effectively deletes the old memo record and creates
a new one.
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
..... if you change the data in these fields often, then you'll need to
PACK MEMO on occassion otherwise the .FPT will grow larger more quickly.
NigelGomm
2006-02-10 03:48:39 UTC
Permalink
Rick,

i just experimented with SET BLOCKSIZE using the same testdata and values of
0 and 33 saved me about 4k.

The data does change often so I attempt to pack the tables (if i can get
exclusive access - it's a multi-user app) on a couple of processes where
many records can get changed. I also distribute a 'Detect & Repair'
companion app that has a 'Pack' option. But that's not always enough so i
have the table vertically and horizontally partitioned (diagonally
partitioned ?) so it doesn't bust the 2GB limit.

but those numbers were on a test system with a packed table so there
shouldn't have been any excess.


thanks

Nigel
Post by Rick Bean
Nigel,
Consider changing the BLOCKSIZE (see SET BLOCKSIZE in help). You can use
SYS(2012) to check the current size. Remember that if you change the data
in these fields often, then you'll need to PACK MEMO on occassion
otherwise the .FPT will grow larger more quickly.
Rick
Post by NigelGomm
I have a table with 3 fields, : one int and 2 binary memo fields.
the 2 memo fields hold a JPEG and ppt file for each record.
if i scan a test table with 33 records and copy the files out the sum
total of the file sizes is about 4.5mb.
But the fpt file is 7.6Mb (packed). That's more overhead than i was expecting.
Any thoughts or suggestions?
tia
Nigel
Josh Assing
2006-02-10 03:26:14 UTC
Permalink
what you'll need to do is "pack memo" on a regular basis; perhaps when you shut
your app down.

What I tend to do is store a reference to the file vs. the file data; which
makes for a smaller memo file & less bloat
Post by NigelGomm
I have a table with 3 fields, : one int and 2 binary memo fields.
the 2 memo fields hold a JPEG and ppt file for each record.
if i scan a test table with 33 records and copy the files out the sum total
of the file sizes is about 4.5mb.
But the fpt file is 7.6Mb (packed). That's more overhead than i was
expecting.
Any thoughts or suggestions?
tia
Nigel
--- AntiSpam/harvest ---
Remove X's to send email to me.
NigelGomm
2006-02-10 03:54:45 UTC
Permalink
thanks Josh


see my replies to Lee & Rick


Nigel
Post by Josh Assing
what you'll need to do is "pack memo" on a regular basis; perhaps when you shut
your app down.
What I tend to do is store a reference to the file vs. the file data; which
makes for a smaller memo file & less bloat
Post by NigelGomm
I have a table with 3 fields, : one int and 2 binary memo fields.
the 2 memo fields hold a JPEG and ppt file for each record.
if i scan a test table with 33 records and copy the files out the sum total
of the file sizes is about 4.5mb.
But the fpt file is 7.6Mb (packed). That's more overhead than i was
expecting.
Any thoughts or suggestions?
tia
Nigel
--- AntiSpam/harvest ---
Remove X's to send email to me.
"Olaf Doschke" <T2xhZi5Eb3NjaGtlQFNldG1pY3MuZGU@strconv.14
2006-02-13 10:13:32 UTC
Permalink
Hi Nigel,

sure you are using a binary memo (M nocptrans), not a
general or blob field?

If I add pics to a binary memo I get few overhead.
In a very simple test I added BMPs from the windows
folder to a dbf and only had few KB overhead (about
1-2 %).

Bye, Olaf.
NigelGomm
2006-02-13 18:14:54 UTC
Permalink
hmm,

i tried with blob and didn't see a difference but i'll go back and check
now.

thanks Olaf

n
Post by "Olaf Doschke" <***@strconv.14
Hi Nigel,
sure you are using a binary memo (M nocptrans), not a
general or blob field?
If I add pics to a binary memo I get few overhead.
In a very simple test I added BMPs from the windows
folder to a dbf and only had few KB overhead (about
1-2 %).
Bye, Olaf.
"Olaf Doschke" <T2xhZi5Eb3NjaGtlQFNldG1pY3MuZGU@strconv.14
2006-02-14 23:22:33 UTC
Permalink
Post by NigelGomm
i tried with blob and didn't see a difference but i'll go back and check
now.
Maybe blob is like binary memo in the respect of how much diskspace
is used.

I know with general fields there is much overhead stored (eg a thumbnail).
And I know with binary memo there is few overhead. And that just
comes from blocksize. setting blocksize different after the data is in the
memo won't help though. I think you are aware of that.

Bye, Olaf.
NigelGomm
2006-02-16 15:14:51 UTC
Permalink
Olaf,

definitely not using General fields.....

The fields are binary memo. No difference when using blob fields. I set
blocksize and reimported after Rick's sugesstion and saved a few k but not
much.

Nigel
Post by "Olaf Doschke" <***@strconv.14
Post by NigelGomm
i tried with blob and didn't see a difference but i'll go back and check
now.
Maybe blob is like binary memo in the respect of how much diskspace
is used.
I know with general fields there is much overhead stored (eg a thumbnail).
And I know with binary memo there is few overhead. And that just
comes from blocksize. setting blocksize different after the data is in the
memo won't help though. I think you are aware of that.
Bye, Olaf.
"Olaf Doschke" <T2xhZi5Eb3NjaGtlQFNldG1pY3MuZGU@strconv.14
2006-02-16 22:58:22 UTC
Permalink
Hi Nigel,

Your factor of about 1.7 FPT size to picture file size
must have it's reason.
So how do you insert the picture files?

I do
APPEND BLANK
APPEND MEMO mPictureMemo FROM cPictureFilename
in a loop through all pictures.

Bye, Olaf.

Loading...