Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread insert into from local table to remote table...
Sat, Jul 1 2006 7:42 AMPermanent Link

"Santy Concepción"
Hi!

I'm trying to gain permormance and speed when inserting records in C/S mode.
With a Table.Append takes about 1.5 seconds per record.
With a SQL "insert into..." it only takes 0.4 seconds per record.

The problem is that I need to insert records from a Local table into a
Remote table, and I can't!

1) "LocalTable" contains the records in my computer
2) RemoteTable is on the Server computer

insert into RemoteTable (field1,field2) select Value1,Value2 from
LocalTable.

Is this possible?
Is there any faster metod to insert records?

Thanks!

Sat, Jul 1 2006 6:18 PMPermanent Link

"Ralf Mimoun"
Santy Concepción wrote:
> Hi!
>
> I'm trying to gain permormance and speed when inserting records in
> C/S mode. With a Table.Append takes about 1.5 seconds per record.

What are you doing with that table? Filtering with OnFilterRecord, some code
in AfterPost, a huge grid connected to the table, or even opening and
closing it for each record? A Insert should take almost no time. And it
should be faster than a INSERT INTO because there is no need to parse the
SQL command.

> With a SQL "insert into..." it only takes 0.4 seconds per record.

> The problem is that I need to insert records from a Local table into a
> Remote table, and I can't!
>
> 1) "LocalTable" contains the records in my computer
> 2) RemoteTable is on the Server computer
>
> insert into RemoteTable (field1,field2) select Value1,Value2 from
> LocalTable.
>
> Is this possible?

No.

> Is there any faster metod to insert records?

Try to find the cause of the slow Insert with your TDBISAMTable. With
transactions and commits every 500 or 1000 records, you should be as fast as
it can get.

Ralf
Sun, Jul 2 2006 3:33 PMPermanent Link

Santy Concepción
Hi, Ralf...

I need to insert only ONE record at a time, but it takes 1.5 seconds.
The record contains about 10 fields (one of them is a BLOB field, BUT IT'S EMPTY!). It has no lookup fields, etc...

I have been doing some tests in C/S mode, and doing a "Table.Append" {...} "Table.Post" takes about 1.5 seconds.
There is no AfterScroll, OnFilterRecord, filters... in that table.

I have noticed that a Table.Locate takes a lot of time too.
Even in a Table with only 5 records and 2 fields, if I do a Locate (integer field), it takes about 1 second to locate the desired record.

Server and Client have a 1MB DSL connection.
I made a simple C/S app just for testing and it takes the same time when Locating and Appending records.

Is it normal?
Sun, Jul 2 2006 4:01 PMPermanent Link

"Ralf Mimoun"
Santy Concepción wrote:
....
> I have been doing some tests in C/S mode, and doing a "Table.Append"
> {...} "Table.Post" takes about 1.5 seconds.
> There is no AfterScroll, OnFilterRecord, filters... in that table.

Is there a datasource attached to the table? Sorry, but 1.5 seconds is about
100 times slower than anything I have seen.

> I have noticed that a Table.Locate takes a lot of time too.

Is that field you are searcing for indexed? Right index, case sensitive or
insensitive according to the Locate options?

> Even in a Table with only 5 records and 2 fields, if I do a Locate
> (integer field), it takes about 1 second to locate the desired
> record.
>
> Server and Client have a 1MB DSL connection.

Ah, ok. You should have told that before. What you see is the latency. With
a SQL statement´, you more or less send the statement to the server and get
back an OK. With a table, you have way more traffic (rough version):

- Client to Server: open table
- Server to Client: OK
- Client to Server: give me x records (filling buffers)
- Server to Client: there are the buffers
- Client to Cerver: I Append
- Server to Client: OK
- Client to Server: Here are the data, post
- Server to Client: OK
- Client to Server: Give me the refreshed data
- Server to Client: here there are

And over and over again a latency of maybe .1 seconds or worse, just because
it's over DSL and internet.

> Is it normal?

Using a DSL line for that operation? Yes, absolutely. And nothing Elevate
can do much about, it's just how table based db access works.

Ralf
Mon, Jul 3 2006 3:29 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Santy,

<< I have been doing some tests in C/S mode, and doing a "Table.Append"
{...} "Table.Post" takes about 1.5 seconds. There is no AfterScroll,
OnFilterRecord, filters... in that table. >>

Try the Insert method instead.  That may help some, since it leaves out an
internal Last call before the actual append takes place.  However, it may be
that the issue is simply network latency, which there isn't much you can do
about short of using a temporary local table, and then using
SaveToStream/LoadFromStream to batch up the inserts for insertion into the
remote table.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Jul 7 2006 6:05 AMPermanent Link

"Santy Concepción"
Hi, Tim...

What about if I use the "insert into" method using Local Mode (not C/S)?
What is faster in Local Mode network (2 computers on a LAN)? "Insert Into"
or "Table.Append" ??
Or is it the same?

Thanks!

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> escribió en el
mensaje news:753BB9FF-E3A3-4B2D-95FC-C89E2D9E0692@news.elevatesoft.com...
> Santy,
>
> << I have been doing some tests in C/S mode, and doing a "Table.Append"
> {...} "Table.Post" takes about 1.5 seconds. There is no AfterScroll,
> OnFilterRecord, filters... in that table. >>
>
> Try the Insert method instead.  That may help some, since it leaves out an
> internal Last call before the actual append takes place.  However, it may
> be that the issue is simply network latency, which there isn't much you
> can do about short of using a temporary local table, and then using
> SaveToStream/LoadFromStream to batch up the inserts for insertion into the
> remote table.
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
>

Fri, Jul 7 2006 11:25 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Santy,

<< What about if I use the "insert into" method using Local Mode (not C/S)?
What is faster in Local Mode network (2 computers on a LAN)? "Insert Into"
or "Table.Append" ??  Or is it the same? >>

It's about the same.  The SQL INSERT needs some extra time for the SQL
parsing/preparation, so that washes with the Table.Last call that is
implicitly called as part of the Table.Append call.  As I said before, the
fastest is the Table.Insert method.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image