Board index » delphi » Am I stupid?..Or is Delphi SLOW!!!

Am I stupid?..Or is Delphi SLOW!!!

I have two tables, each with 34 000 records in a one-to-one
correspondance. The two tables both have the same index
field called ProdCode (A 20). I want to display a grid which
contains fields from both these tables.

I create a query with the statement:

Select * from table1,table2
where table1.prodcode = table2.prodcode

I then want to open the query to display the results in a grid.
The OPEN statement takes about 15 seconds to execute????

Is there a better (faster) way to do this?

Thanking you in advance
Stephen

 

Re:Am I stupid?..Or is Delphi SLOW!!!


I have two tables, each with 34 000 records in a one-to-one
correspondance. The two tables both have the same index
field called ProdCode (A 20). I want to display a grid which
contains fields from both these tables.

I create a query with the statement:

Select * from table1,table2
where table1.prodcode = table2.prodcode

I then want to open the query to display the results in a grid.
The OPEN statement takes about 15 seconds to execute????

Is there a better (faster) way to do this?

It looks like you use local database (paradox, dbase). In this case no
indizes will be used (exception is using case insensitive indices, don't
know exactly).
Convert your app to an sql server or use the methods of TTable.

Heiko

Re:Am I stupid?..Or is Delphi SLOW!!!


Do you have an index on those fields ? and do you set the index of the
tables to this index before invoking the query ?
Using a text field may also be slower. A numerical field used as a primary
index would give better performance.

Denis

Re:Am I stupid?..Or is Delphi SLOW!!!


Try creating an StoredProcedure.
Gr.
Ben

VPL Man <vpl...@icon.co.za> wrote in article
<74tbf1$9v...@hermes.is.co.za>...
I have two tables, each with 34 000 records in a one-to-one
correspondance. The two tables both have the same index
field called ProdCode (A 20). I want to display a grid which
contains fields from both these tables.

I create a query with the statement:

Select * from table1,table2
where table1.prodcode = table2.prodcode

I then want to open the query to display the results in a grid.
The OPEN statement takes about 15 seconds to execute????

Is there a better (faster) way to do this?

Thanking you in advance
Stephen

----------

Re:Am I stupid?..Or is Delphi SLOW!!!


Quote
Gratis component wrote in message <01be26bf$22c8da30$1564a8c0@server1>...
>Try creating an StoredProcedure.
>Gr.
>Ben

>VPL Man <vpl...@icon.co.za> wrote in article
><74tbf1$9v...@hermes.is.co.za>...
>I have two tables, each with 34 000 records in a one-to-one
>correspondance. The two tables both have the same index
>field called ProdCode (A 20). I want to display a grid which
>contains fields from both these tables.

You say same index but what about keys ? Is the same field primary key to
the first table and foreign to the other ?
Quote

>I create a query with the statement:

>Select * from table1,table2
>where table1.prodcode = table2.prodcode

>I then want to open the query to display the results in a grid.
>The OPEN statement takes about 15 seconds to execute????

>Is there a better (faster) way to do this?

>Thanking you in advance
>Stephen

>----------

Re:Am I stupid?..Or is Delphi SLOW!!!


It's not the better way to ask a question... Most of people here find Delphi
very very fast so... ; )

--
Sygal

Quote
Vasilis Stergioulis <vass...@geocities.com> wrote in message

news:758138$k7$1@medousa.forthnet.gr...
Quote

>Gratis component wrote in message <01be26bf$22c8da30$1564a8c0@server1>...
>>Try creating an StoredProcedure.
>>Gr.
>>Ben

>>VPL Man <vpl...@icon.co.za> wrote in article
>><74tbf1$9v...@hermes.is.co.za>...
>>I have two tables, each with 34 000 records in a one-to-one
>>correspondance. The two tables both have the same index
>>field called ProdCode (A 20). I want to display a grid which
>>contains fields from both these tables.

>You say same index but what about keys ? Is the same field primary key to
>the first table and foreign to the other ?

>>I create a query with the statement:

>>Select * from table1,table2
>>where table1.prodcode = table2.prodcode

>>I then want to open the query to display the results in a grid.
>>The OPEN statement takes about 15 seconds to execute????

>>Is there a better (faster) way to do this?

>>Thanking you in advance
>>Stephen

>>----------

Re:Am I stupid?..Or is Delphi SLOW!!!


Your problem has nothing to do with Delphi or VB or whatever - it is a
matter of getting the databaseserver to do things the easiest way...

B.Saether

REMOVETHISbsaet...@online.no

Other Threads