List:General Discussion« Previous MessageNext Message »
From:Ronan Lucio Date:January 18 2005 6:50pm
Subject:Re: Doubt about Performance
View as plain text  
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


Thread
Doubt about PerformanceRonan Lucio18 Jan
  • Re: Doubt about PerformanceRonan Lucio18 Jan
  • Re: Doubt about PerformanceSasha Pachev18 Jan
  • Re: Doubt about PerformanceSGreen18 Jan
  • Re: Doubt about PerformanceRonan Lucio18 Jan
Re: Doubt about PerformanceSGreen18 Jan
  • Re: Doubt about PerformanceRonan Lucio19 Jan
RE: Doubt about PerformanceDathan Pattishall19 Jan