Subject Re: [firebird-support] varchar fields and memory
Author Daniel Rail
Hi,

At September 7, 2004, 12:35, kaczy27 wrote:

> I've always thought that defining the field as varchar is a way to
> avoid large memory consumption.

> I have a table that store text data, and although the data itself
> rarely exceed 50 characters I set it to be varchar (1024).

I usually set it to what the maximum would be. So, if in your case
the maximum could be 100 chars, then set it to varchar(100).

> The select often returns hundreds of records and so my question is:
> do I use 1 MB of client station memory to return 1000 records even
> if they contain on average 50 characters? or do I use 50 kB?

The memory consumption on the client would be directly related to the
programming environment and connectivity components used to interface
with FB's client DLL. Because, FB's client DLL is just a mediator
between the server and your application and doesn't store any of the
data retrieved from the server(that's your application's job).

> Does server internally use 100 MB to perform grouping from 100.000
> records?

This is a good question. Probably a developer would be more able to
answer this question.

> That is quite important to me, I'd have to redesign entire database
> to acomodate blobs instead of varchars in such case.

That's understandable.

--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)