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).

scope conceptsWithFieldGreaterThan.

sbool #verbose;

static <A extends Concept> Cl<A> nuLike conceptsWithFieldGreaterThan(Class<A> c, S field, O value) {
  ret conceptsWithFieldGreaterThan(db_mainConcepts(), c, field, value);
}

static <A extends Concept> Cl<A> conceptsWithFieldGreaterThan(Concepts concepts, Class<A> c, S field, O value) {
  // indexed
  IFieldIndex<A, O> index = concepts.getFieldIndex(c, field);
  if (index cast ConceptFieldIndexDesc)
    ret index.objectsWithValueGreaterThan(value);
    
  // filter manually
  if (verbose)
    print("conceptsWithFieldGreaterThan: table scan of " + c + " for field " + field);
  ret objectsWhereFieldGreaterThan(concepts.list(c), field, value);
}

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: 247 / 336
Version history: 3 change(s)
Referenced in: [show references]