Greg,

Thank you very much for your help.

> An index the full size of the distinct key is probably very quick
especially
> if it only has 20 distinct values.  OTOH, if you already know you have a
> small number of distinct values, could you just store them normalized in a
> different table?

Actually, it is.
It has some tables:

features
=====
- id
- description

groups
=====
- id
- description

products
======
- id
- description
- group_id
- feature_id

And Iīll use a SELECT like this:

SELECT DISTINCT features.description
FROM products
LEFT JOIN features ON (products.feature_id = features.id)
WHERE products.group_id = $var_group
AND products.features_id > 0

The table products should have a million of records, but the
filtered query should goes over a  thousand records (filtered
by group_id) and return about 20 distinct lines.

Itīs my situation but I donīt know how heavy such query is
for the database and how viable such query is.

Thanks in advance,
Ronan



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

Reply via email to