Query speed and results

Query speed and results

Postby lguy » Sat 28 May 2005 15:51

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,
lguy
 
Posts: 2
Joined: Sat 28 May 2005 15:19
Location: USA

Postby swierzbicki » Mon 30 May 2005 07:33

Quick question : have you set some indexes ?, if not, setting up will speed up your query result
swierzbicki
 
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Postby Ikar » Mon 30 May 2005 08:51

> 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
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56


Return to MySQL Data Access Components