Skip to content

Implement efficient prefetch for parallel bitmap heap scan #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 14, 2023

Conversation

knizhnik
Copy link

@knizhnik knizhnik commented Feb 8, 2023

No description provided.

@vadim2404 vadim2404 requested a review from MMeent February 10, 2023 11:53
@knizhnik knizhnik force-pushed the bitmap_heap_scan_v15 branch from 722e92d to 0531b92 Compare February 14, 2023 16:11
Copy link

@MMeent MMeent left a comment

Choose a reason for hiding this comment

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

I'm still not convinced that we should be updating the io concurrency limit, but all right...

@knizhnik
Copy link
Author

I'm still not convinced that we should be updating the io concurrency limit, but all right...

May be this program will convince you:

#include <stdio.h>
#include <stdlib.h>

long sum(unsigned mod) {
        long sum = 0;
        switch (mod) {
        case 1000:
                for (unsigned i = 0; i < 1000000000; i++) {
                        sum += i % 1000;
                }
                break;
        case 1024:
                for (unsigned i = 0; i < 1000000000; i++) {
                        sum += i % 1024;
                }
                break;
        default:
                for (unsigned i = 0; i < 1000000000; i++) {
                        sum += i % mod;
                }
        }
        return sum;
}

int main(int argc, char const* argv[]) {
        unsigned mod = atoi(argv[1]);
        printf("sum=%ld\n", sum(mod));
        return 0;
}

At EC2 node results are the following:

admin@ip-172-31-30-176:~$ time ./a.out 1024
sum=511499868928

real    0m0.307s
user    0m0.307s
sys     0m0.000s
admin@ip-172-31-30-176:~$ time ./a.out 1000
sum=499500000000

real    0m0.625s
user    0m0.625s
sys     0m0.000s
admin@ip-172-31-30-176:~$ time ./a.out 1023
sum=510999950187

real    0m7.096s
user    0m7.097s
sys     0m0.000s

So division by constant 1024 (AND) is about two times faster than division by 1000 (MUL) and ~20 faster than division by variable (DIV).

@knizhnik knizhnik merged commit 9612617 into REL_15_STABLE_neon Feb 14, 2023
@knizhnik knizhnik deleted the bitmap_heap_scan_v15 branch February 14, 2023 17:00
MMeent pushed a commit that referenced this pull request Feb 16, 2023
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
MMeent pushed a commit that referenced this pull request Feb 16, 2023
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
MMeent pushed a commit that referenced this pull request May 11, 2023
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
MMeent pushed a commit that referenced this pull request May 11, 2023
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request Aug 10, 2023
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request Aug 10, 2023
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request Nov 8, 2023
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request Nov 8, 2023
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request Nov 8, 2023
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request Nov 8, 2023
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request Nov 8, 2023
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request Feb 5, 2024
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request Feb 5, 2024
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request Feb 5, 2024
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request Feb 5, 2024
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request Feb 6, 2024
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request Feb 6, 2024
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request May 10, 2024
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
tristan957 pushed a commit that referenced this pull request May 10, 2024
* Implement efficient prefetch for parallel bitmap heap scan

* Change MAX_IO_CONCURRENCY to be power of 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants