Re: [DISCUSS] IEP-71 Public API for secondary index search

2021-08-26 Thread Courtney Robinson
Prefer 1 from Teras' response. Specifying index name is preferred. I've seen customers do idx(A,B) and idx(B,A) where semantics change between the two. Regards, Courtney Robinson Founder and CEO, Hypi Tel: ++44 208 123 2413 (GMT+0) https://hypi.io On Thu, Aug

Re: [DISCUSS] IEP-71 Public API for secondary index search

2021-08-26 Thread Taras Ledkov
Hi, My proposal: 1. Don't search index by criteria, specify the index name always (preferred). OR 2. Search index by criteria without check the order of criteriones. Use the Set of criterions instead of the ordered collection. In the strange case when the both index exist (a, b) and (b, a) -

Re: [DISCUSS] IEP-71 Public API for secondary index search

2021-08-26 Thread Maksim Timonin
> But lt("b", 1) AND lt("a", 2) is equivalent to lt("a", 1) AND lt("b", 2) according with criteria API and javadoc of the 'IndexQuery#setCriteria' method. I updated javadoc, Andrey suggested writing this in javadocs, so now there is a note about field order. > If the user uses logical criteria in

Re: [DISCUSS] IEP-71 Public API for secondary index search

2021-08-26 Thread Maksim Timonin
There are some thoughts about strict field order: 1. Index (A, B) is not equivalent to index (B, A). Some queries may have different performance on such indexes, and users have to specify the right index. What if both indexes exist? 2. We should avoid cases when a user uses in query only field B fo

Re: [DISCUSS] IEP-71 Public API for secondary index search

2021-08-26 Thread Ivan Daschinsky
1. I suppose, that the next step is to implement the api for manually creating index. I think that user wants to create index that will speed up his criteria base queries, so he or she will use the same criteria to define the index. So no problem at all 2. We should print warning or throws exceptio

Re: [DISCUSS] IEP-71 Public API for secondary index search

2021-08-26 Thread Taras Ledkov
Hi, It is an usability nightmare to make user write index name in all cases. I don't see any difference between specifying the index name and specifying the index fields in the right order. Do you see? Let's there is the index: idx_A_B ON TBL (A, B) Is it OK that the query like below doesn't

Re: [DISCUSS] IEP-71 Public API for secondary index search

2021-08-26 Thread Andrey Mashenkov
@Ivan Daschinsky By the way, users are forced to specify index condition in order that match column order in the index. On Thu, Aug 26, 2021 at 3:24 PM Ivan Daschinsky wrote: > I am against to make user write index name. It is quite simple and > straightforward algorithm to match index to fiel

Re: [DISCUSS] IEP-71 Public API for secondary index search

2021-08-26 Thread Ivan Daschinsky
I am against to make user write index name. It is quite simple and straightforward algorithm to match index to field names, so it is strange to compare it to sql engine optimizer. It is an usability nightmare to make user write index name in all cases. чт, 26 авг. 2021 г., 14:42 Maksim Timonin :

Re: [DISCUSS] IEP-71 Public API for secondary index search

2021-08-26 Thread Maksim Timonin
Hi, Igniters! There is a discussion about how to specify an index to query with an IndexQuery [1]. Currently my PR provides 2 ways to specify index: 1. With a table and index name; 2. With a table and list of index fields (without index name). In this case IndexQueryProcessor tries to find an inde