git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 85c5428) | patch
Optimize a few list_delete_ptr calls
2020年10月22日 01:36:32 +0000 (14:36 +1300)
2020年10月22日 01:36:32 +0000 (14:36 +1300)
commit e7c2b95d37a2b9c01367f7ccc55703555b39c81c
Optimize a few list_delete_ptr calls

There is a handful of places where we called list_delete_ptr() to remove
some element from a List. In many of these places we know, or with very
little additional effort know the index of the ListCell that we need to
remove.

Here we change all of those places to instead either use one of;
list_delete_nth_cell(), foreach_delete_current() or list_delete_last().
Each of these saves from having to iterate over the list to search for the
element to remove by its pointer value.

There are some small performance gains to be had by doing this, but in the
general case, none of these lists are likely to be very large, so the
lookup was probably never that expensive anyway. However, some of the
calls are in fairly hot code paths, e.g process_equivalence(). So any
small gains there are useful.

Author: Zhijie Hou and David Rowley
Discussion: https://postgr.es/m/b3517353ec7c4f87aa560678fbb1034b@G08CNEXMBPEKD05.g08.fujitsu.local
src/backend/optimizer/path/equivclass.c diff | blob | blame | history
src/backend/optimizer/path/joinpath.c diff | blob | blame | history
src/backend/parser/parse_expr.c diff | blob | blame | history
src/backend/parser/parse_utilcmd.c diff | blob | blame | history
src/backend/rewrite/rewriteHandler.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /