Page 1 of 1

Query speed and results

Posted: Sat 28 May 2005 15:51
by lguy
This is the query SQL:

select distinct lastname from vdata order by lastname

vdata has about 5 million rows, and this query returns about 6,000 rows. 2 questions:

1. How can I improve its speed? I takes about 9 seconds to run as opposed to 2 seconds when run from the MySQL Console app.

2. How can I figure out the number of rows returned by the query? I do a FetchRows but that runs the number 25.

Thanks,

Posted: Mon 30 May 2005 07:33
by swierzbicki
Quick question : have you set some indexes ?, if not, setting up will speed up your query result

Posted: Mon 30 May 2005 08:51
by Ikar
> 1. How can I improve its speed? I takes about 9 seconds to run as opposed
> to 2 seconds when run from the MySQL Console app.

Try to set FetchAll to False. Please read carefully MyDAC help about restrictions of this mode.

> 2. How can I figure out the number of rows returned by the query?
> I do a FetchRows but that runs the number 25.

Just set Options.QueryRecCount to True