Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Implement wand-like optimization for boolean query #527

Merged
merged 17 commits into from
Aug 8, 2023

Conversation

MBkkt
Copy link
Contributor

@MBkkt MBkkt commented Jun 15, 2023

Also:

  • Compute score single time
  • Make wand score compatible work
  • Add wand optimization for conjunction, disjunction and min_match

master:

Index read time calls:1, time: 50293 us, avg call: 50293 us
Order build time calls:1, time: 1 us, avg call: 1 us
Query building (AndHighHigh) time calls:1000, time: 27679 us, avg call: 27.679 us
Query building (AndHighLow) time calls:1000, time: 20964 us, avg call: 20.964 us
Query building (AndHighMed) time calls:1000, time: 28698 us, avg call: 28.698 us
Query building (HighTerm) time calls:282, time: 1560 us, avg call: 5.53191 us
Query building (LowTerm) time calls:1000, time: 8037 us, avg call: 8.037 us
Query building (MedTerm) time calls:1000, time: 6794 us, avg call: 6.794 us
Query building (MinMatch2High2Med) time calls:2, time: 320 us, avg call: 160 us
Query building (Or4High) time calls:2, time: 78 us, avg call: 39 us
Query building (Or6High4Med2Low) time calls:2, time: 203 us, avg call: 101.5 us
Query execution (AndHighHigh) time calls:1000, time: 84034036 us, avg call: 84034 us
Query execution (AndHighLow) time calls:1000, time: 1891038 us, avg call: 1891.04 us
Query execution (AndHighMed) time calls:1000, time: 29832592 us, avg call: 29832.6 us
Query execution (HighTerm) time calls:282, time: 55568 us, avg call: 197.05 us
Query execution (LowTerm) time calls:1000, time: 240645 us, avg call: 240.645 us
Query execution (MedTerm) time calls:1000, time: 230304 us, avg call: 230.304 us
Query execution (MinMatch2High2Med) time calls:2, time: 1095620 us, avg call: 547810 us
Query execution (Or4High) time calls:2, time: 1831226 us, avg call: 915613 us
Query execution (Or6High4Med2Low) time calls:2, time: 3189758 us, avg call: 1.59488e+06 us
Total Time calls:1, time: 384756430 us, avg call: 3.84756e+08 us

this branch:

Index read time calls:1, time: 49971 us, avg call: 49971 us
Order build time calls:1, time: 1 us, avg call: 1 us
Query building (AndHighHigh) time calls:1000, time: 21830 us, avg call: 21.83 us
Query building (AndHighLow) time calls:1000, time: 20462 us, avg call: 20.462 us
Query building (AndHighMed) time calls:1000, time: 22017 us, avg call: 22.017 us
Query building (HighTerm) time calls:282, time: 1846 us, avg call: 6.5461 us
Query building (LowTerm) time calls:1000, time: 6599 us, avg call: 6.599 us
Query building (MedTerm) time calls:1000, time: 6743 us, avg call: 6.743 us
Query building (MinMatch2High2Med) time calls:2, time: 314 us, avg call: 157 us
Query building (Or4High) time calls:2, time: 99 us, avg call: 49.5 us
Query building (Or6High4Med2Low) time calls:2, time: 208 us, avg call: 104 us
Query execution (AndHighHigh) time calls:1000, time: 32042074 us, avg call: 32042.1 us
Query execution (AndHighLow) time calls:1000, time: 1538670 us, avg call: 1538.67 us
Query execution (AndHighMed) time calls:1000, time: 15533962 us, avg call: 15534 us
Query execution (HighTerm) time calls:282, time: 55386 us, avg call: 196.404 us
Query execution (LowTerm) time calls:1000, time: 228807 us, avg call: 228.807 us
Query execution (MedTerm) time calls:1000, time: 227585 us, avg call: 227.585 us
Query execution (MinMatch2High2Med) time calls:2, time: 809330 us, avg call: 404665 us
Query execution (Or4High) time calls:2, time: 1342383 us, avg call: 671192 us
Query execution (Or6High4Med2Low) time calls:2, time: 2340679 us, avg call: 1.17034e+06 us
Total Time calls:1, time: 316445536 us, avg call: 3.16446e+08 us

@MBkkt MBkkt marked this pull request as ready for review July 25, 2023 11:19
Copy link
Contributor

@Dronplane Dronplane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in general. Some minor comments.

core/search/disjunction.hpp Show resolved Hide resolved
Copy link
Contributor

@Dronplane Dronplane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MBkkt MBkkt merged commit f00490a into master Aug 8, 2023
1 check passed
@MBkkt MBkkt deleted the chore/boolean-query-wand branch August 8, 2023 13:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants