| Author |
Message |
Guest
|
Posted: Thu Jun 19, 2003 7:39 am Post subject: Correct handling of "text" field types |
|
|
Hi,
Still evaluating.
How do I handle inserting or updating records with "text" field types?
According to Sybase documentation, you are supposed to use the "readtext" and "writetext" statements for updating text or image field types so as to avoid sending large field data to the transaction log.
There is some reference to support for BLOB fields in your changes list, however I can find no other mention in your documentation.
Are the readtext / writetext statements handled at a lower level in your driver?
In a nutshell, what is the recommended method of inserting and updating records containing Sybase text field types?
Thanks in Advance.
Greg |
|
| Back to top |
|
 |
VISOCO Support VISOCO Software Support
Joined: 16 Jul 2002 Posts: 96
|
Posted: Thu Jun 19, 2003 8:39 am Post subject: |
|
|
Hello,
there are no specific methods of inserting and updating records. We made an emphasis on a compatibility with old BDE applications. So, you can use ordinary statements with parameters of ftMemo datatype.
| Code: |
SQLDataSet1.CommandText := 'insert into T1 values (:test)';
SQLDataSet1.Params[0].AsMemo := '<some text>';
SQLDataSet1.ExecSQL;
|
About readtext/writetext and large amounts of data in the transaction log... We are still working on it. |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Jun 28, 2003 4:09 am Post subject: |
|
|
| VISOCO support wrote: | | About readtext/writetext and large amounts of data in the transaction log... We are still working on it. |
I thought you might be interested in some further feedback on this.
After lots of testing in the application I am converting from to utilise your dbExpress component, I have come to the conclusion that the "WRITETEXT" method is too inefficient and therefore unecessary for typical "text" field usage (unless perhaps you have an application where you are sequentually writing a very large number of large size text field data - eg: many megabytes of text data).
Although Sybase prescribe writetext as the appropriate method for large text or image data fields, it is a significantly slower process than a standard insert or update, per your example above.
The problem is that you need to first have a pre-existing record with an initialised text field pointer (which involves first inserting a non-null text field, or updating an existing null value text field record). Then you need to "select" the record to read the textptr() value into a local variable, before doing the "writetext" update to write the actual "text" field into the database.
In testing with about 10000 records each containing an average 20KB size text field, runtimes on my test server were ~16mins for a direct insert or update approach, versus ~25mins by utilising the writetext method.
Assuming your log is appropriately sized and you are using trunc on checkpoint, I would now recommend avoiding writetext except in extreme cases where it might perhaps be warranted.
I would be interested in anyone elses comments on this topic.
Regards
Greg |
|
| Back to top |
|
 |
|
©VISOCO Software. phpBB by phpBB Group
|