Subject | Re: Does object name length matter |
---|---|
Author | ainpoissee |
Post date | 2009-11-13T15:05:02Z |
--- In firebird-support@yahoogroups.com, Marcin Bury <mbury@...> wrote:
However, I don't think that object name length is importand in the case you're making - the statement is sent over the wire only once and thus the hit of the object name length isn't that significant. Ie when using code like
query.SQL := 'SELECT Field1, Field2, Field3 FROM TAB...';
while(not query.eof)do data[x]:= query.Field1
or
query.SQL := 'UPDATE TAB SET Field1 = :Par1, Field2 = :Par2 WHERE()';
while(not data.eof)do begin
query.par1 := data.Value[1]
...
query.Execute;
end
then the field names are sent only once and rest of the data travelling over the wire is "raw record data" without any metadata like field name/size etc... at least that's what I would expect.
So yes, object name length matters when you only use each statement once (and they are so big that they won't fit into single packet), but in a "batch mode" where the size of statement is tiny compared to the actual data it isn't that significant...
However, using 4 byte field where 1 byte would do seems significant in this context - for each 1000 records youre sending 3000 bytes of "noise" over the wire... but Dimitry seems to be sure that it wouldn't make any difference...
ain
>Marcin, it seems that I misunderstanded your original message... I thought about how server handles the names.
> And then imagine amount of data sent to server in both cases. I don't
> know client architecture but sql statements are interpreted by a server
> and probably client library transfers them unchanged. So optimizing the
> amount of data received consider also amount of data sent to server.
However, I don't think that object name length is importand in the case you're making - the statement is sent over the wire only once and thus the hit of the object name length isn't that significant. Ie when using code like
query.SQL := 'SELECT Field1, Field2, Field3 FROM TAB...';
while(not query.eof)do data[x]:= query.Field1
or
query.SQL := 'UPDATE TAB SET Field1 = :Par1, Field2 = :Par2 WHERE()';
while(not data.eof)do begin
query.par1 := data.Value[1]
...
query.Execute;
end
then the field names are sent only once and rest of the data travelling over the wire is "raw record data" without any metadata like field name/size etc... at least that's what I would expect.
So yes, object name length matters when you only use each statement once (and they are so big that they won't fit into single packet), but in a "batch mode" where the size of statement is tiny compared to the actual data it isn't that significant...
However, using 4 byte field where 1 byte would do seems significant in this context - for each 1000 records youre sending 3000 bytes of "noise" over the wire... but Dimitry seems to be sure that it wouldn't make any difference...
ain