Hi,

Some recommendations should be applied to every SQL query:

1)You should avoid using __SCAN_
2)You should use LAZY if the result set is big.
3)You should inline the indexes

Please read my comments:

1)My question is what is happening with all those indexes when an entry is
updated but, none of the indexed fields (except one) are being changed? In
our case, we are only flipping a boolean value of only 1 field. Is this
change triggering updates in ALL the indexes associated with the cache?

Yes, all your indexes will be rebuilt (new value will be inserted in the index tree).

2)When we update entry field SEGMENT_1 field with a True, are the other 99
indexes updated?

It looks like yes.

3)Those tickets I mentioned seem to be related but I would like to have your
confirmation.

Yes, https://issues.apache.org/jira/browse/IGNITE-7015 is related to this behavior. You can try to highlite it on the development mail list.

BR,
Andrei
2/13/2020 5:50 PM, xero пишет:
Hi Andrei, thanks for taking the time to answer my question. I will consider
your suggestion if we decide to switch to a multiple tables approach that
will require those JOIN considerations. But, in this case we have only 1
cache and the operation that we are executing is an update. We tried using
SQL-Update but we also tried using a CacheEntryProcessor directly. My
question is what is happening with all those indexes when an entry is
updated but, none of the indexed fields (except one) are being changed? In
our case, we are only flipping a boolean value of only 1 field. Is this
change triggering updates in ALL the indexes associated with the cache?

Cache is like this (with indexes on all fields):
id|(other fields)|segment_1|segment_2|segment_2|...|segment_99|segment_100

Then we try updating a batch of entries with an invokeAll using a
CacheEntryProcessor:
        public Void process(MutableEntry<Long, BinaryObject> entry, Object...
arguments) {
                        final BinaryObjectBuilder builder =
entry.getValue().toBuilder().setField("SEGMENT_1", true);
                        entry.setValue(builder.build());

                        return null;
                }
When we update entry field SEGMENT_1 field with a True, are the other 99
indexes updated?
Those tickets I mentioned seem to be related but I would like to have your
confirmation.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to