You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by tomk <rr...@gmail.com> on 2016/05/20 23:38:19 UTC

What index should I create ?

Hello,
My question is:
What index(es) should I create ? I have 10 columns, where four of  them will
be used as filter (where - equality and inequality) and field for groupby.  
It should be four separate index, as:
                               <constructor-arg value="A"/>
                                                <constructor-arg value="B"/>
                                                <constructor-arg value="C"/>
                                                <constructor-arg value="D"/>
or group index:
                                              <constructor-arg>
                                                  <list>
                                                      <value>A</value>
                                                      <value>B</value>
                                                      <value>C</value>
                                                      <value>D/value>                                                      
                                                  </list>
                                              </constructor-arg>



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/What-index-should-I-create-tp5068.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: What index should I create ?

Posted by vkulichenko <va...@gmail.com>.
Please refer to [1] and other sections of 'SQL queries' page for some
information about this. Most likely, in your case you will need to create
individual indexes for all field that can be used in WHERE clause. Whether
or not you need group indexes, depend on subset sizings after indexes are
applied and on particular queries you're going to execute. You should run
tests and use EXPLAIN to check indexes are used.

[1] https://apacheignite.readme.io/docs/sql-queries#choosing-indexes

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/What-index-should-I-create-tp5068p5176.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: What index should I create ?

Posted by tomk <rr...@gmail.com>.
1. WHERE {A,B,C,D}
(all possible combinations - AND, for example)
where A > 100 AND D < 1000
WHERE B > 20
....

GROUPBY(A)
GROUPBY(B)
GROUPBY(C)
GROUPBY(D)




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/What-index-should-I-create-tp5068p5133.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: What index should I create ?

Posted by vkulichenko <va...@gmail.com>.
Hi,

It depends on the query that you're going to execute, size of the table and
sizes of the result sets. Please provide this information and I will try to
help.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/What-index-should-I-create-tp5068p5091.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.