Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread EDB2 : can i have a list of UNIQUE value of a field ? (with index )
Wed, Oct 29 2008 10:22 AMPermanent Link

"Mauro Botta"
Hi

EDB 2.02

Can i have a list of UNIQUE value of field ,using the index ?

like this :

Select distinct MYFIELD1 from MyTable

this is a HUGE file. i have a index for MYFIELD1



DbIsam4 do query but don't work with index ( very slow )
Wed, Oct 29 2008 2:06 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mauro,

<< Can i have a list of UNIQUE value of field ,using the index ?

like this :

Select distinct MYFIELD1 from MyTable

this is a HUGE file. i have a index for MYFIELD1 >>

With EDB you need to have a PRIMARY constraint on the column in question in
order to EDB to be able to optimize such a query and use the constraint's
internal index.   A UNIQUE constraint is not enough, because it allows for
multiple NULL values in the constraint's internal index.

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Oct 30 2008 4:51 AMPermanent Link

"Mauro Botta"

> With EDB you need to have a PRIMARY constraint on the column in question
> in
> order to EDB to be able to optimize such a query and use the constraint's
> internal index.   A UNIQUE constraint is not enough, because it allows for
> multiple NULL values in the constraint's internal index.

then.. don't support it Frown

in PRIMARY constraint ,  of course.... but is useless here. ( is 1:1
already )
Thu, Oct 30 2008 12:57 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mauro,

<< then.. don't support it Frown>>

Don't support *what* ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Oct 31 2008 6:29 AMPermanent Link

"Mauro Botta"
> Don't support *what* ?

i have this table

FIELD1
1
1
2
2
3
4
4
4
5
10
10

i need extract : 1-2-3-4-5-10 in fast mode , having a index for FIELD1

With EDB 2 , i can do it ?
Fri, Oct 31 2008 12:58 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mauro,

<< i have this table >>

I already answered your question regarding this.  EDB can only use a PRIMARY
constraint's internal index in order to optimize a single-column DISTINCT.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image