On Fri, Sep 2, 2022 at 2:52 AM Nathan Bossart <nathandboss...@gmail.com> wrote:
> I'm hoping to spend a bit more time looking for additional applications of > the pg_lfind*() suite of functions (and anywhere else where SIMD might be > useful, really). If you have any ideas in mind, I'm all ears. +1 for the proposal. I did some simple grep work in the source codes but not too much outputs besides the two places addressed in your patches. Here are some places I noticed that might be optimized with pg_lfind*(). But 1) these places have issues that arguments differ in signedness, and 2) I'm not sure whether they are performance-sensitive or not. In check_valid_internal_signature() for (int i = 0; i < nargs; i++) { if (declared_arg_types[i] == ret_type) return NULL; /* OK */ } In validateFkOnDeleteSetColumns() for (int j = 0; j < numfks; j++) { if (fkattnums[j] == setcol_attnum) { seen = true; break; } } In pg_isolation_test_session_is_blocked() for (i = 0; i < num_blocking_pids; i++) for (j = 0; j < num_interesting_pids; j++) { if (blocking_pids[i] == interesting_pids[j]) PG_RETURN_BOOL(true); } In dotrim() for (i = 0; i < setlen; i++) { if (str_ch == set[i]) break; } if (i >= setlen) break; /* no match here */ And the function has_lock_conflicts(). Thanks Richard