Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

19
LINES

< > BotCompany Repo | #1028354 // conceptsWithFieldGreaterThan - try to use index

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (13158L/89K).

1  
scope conceptsWithFieldGreaterThan.
2  
3  
sbool #verbose;
4  
5  
static <A extends Concept> Cl<A> nuLike conceptsWithFieldGreaterThan(Class<A> c, S field, O value) {
6  
  ret conceptsWithFieldGreaterThan(db_mainConcepts(), c, field, value);
7  
}
8  
9  
static <A extends Concept> Cl<A> conceptsWithFieldGreaterThan(Concepts concepts, Class<A> c, S field, O value) {
10  
  // indexed
11  
  IFieldIndex<A, O> index = concepts.getFieldIndex(c, field);
12  
  if (index cast ConceptFieldIndexDesc)
13  
    ret index.objectsWithValueGreaterThan(value);
14  
    
15  
  // filter manually
16  
  if (verbose)
17  
    print("conceptsWithFieldGreaterThan: table scan of " + c + " for field " + field);
18  
  ret objectsWhereFieldGreaterThan(concepts.list(c), field, value);
19  
}

Author comment

Began life as a copy of #1025936

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1028354
Snippet name: conceptsWithFieldGreaterThan - try to use index
Eternal ID of this version: #1028354/4
Text MD5: f92b9e8b8d2938f6cff1d22dc8830667
Transpilation MD5: 3c592c282f5d473f88c6f571ecdc108a
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-06-13 12:24:56
Source code size: 723 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 249 / 339
Version history: 3 change(s)
Referenced in: [show references]