phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yuhao Bi <byh0...@gmail.com>
Subject Re: Can we create an secondary index for two or more columns?
Date Sun, 17 May 2015 14:34:56 GMT
Hi Xiao Tao,

You can create another secondary index on the same columns.
    create index another_index on EXAMPLE(M.C1, M.C0)

After doing that, query b) should return faster.

2015-05-17 22:25 GMT+08:00 Tao Xiao <xiaotao.cs.nju@gmail.com>:

> I tried to build secondary index for two columns, *M.C0* and *M.C1*:
>
>       create index my_idx on EXAMPLE (M.C0, M.C1)
>
>
> Then I tried to query by two indexes, respectively:
>
>     a). select M.C0 from EXAMPLE where M.C0 = 'c0_00000001'
>     b). select M.C1 from EXAMPLE where M.C1 = 'c1_00000001'
>
> Query a) returned results in less than 0.3 second, and query b) returned
> results in about 13 seconds. It seems that index was built for column
> *M.C0*, not *M.C1*.
>
> Can we build secondary index for two or more columns ?
>
> Thanks.
>

Mime
View raw message