As a storage engine, federated does not have the information as to exactly which columns have been selected. This information is simply not passed down to the engine.

However, if there is index support for a query then MySQL will indicate to the engine if it is only interested in the columns of the index, or in all columns. In this case the engine can optimize the retrieval by only returning the rows of the index (in most engines this saves accessing the data record).

So I am not sure how federated works, but you could try creating an index on the e01_system.category (Id,name). Then you may need to force the use of the index by modifying your query, for example:

select Id,name from e01_system.category where id > 0

On Aug 9, 2006, at 8:26 AM, wangxu wrote:

who can help me?
----- Original Message -----
From: "wangxu" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Wednesday, August 02, 2006 5:29 PM
Subject: question about the query against to the federated engine tables


I have a question about the query against to the federated engine tables. As the following example:

    "select Id,name from e01_system.category"
    Note: the "e01_system.category" is a federated table.

I select only tow fields from the federated table "category" with the above sql statement. But it seemed as if gets all the fields of the table (the table has more then ten fields actually), so the performance of the sql stetement is very slow when the table's size is very big.I conclude this through monitoring the throughput of the network with a network tool named "sniffer". I think the federated table works not as what i expected.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to