Re: Inlining comparators as a performance optimisation
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Peter Geoghegan <peter@2ndquadrant.com>, PG Hackers <pgsql-hackers@postgresql.org>
Date: 2011-12-02T05:16:08Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Speed up conversion of signed integers to C strings.
- 4fc115b2e981 9.1.0 cited
-
Remove some unnecessary tests of pgstat_track_counts.
- f4d242ef9473 9.1.0 cited
-
Remove cvs keywords from all files.
- 9f2e21138693 9.1.0 cited
-
Code cleanup for function prototypes: change two K&R-style prototypes
- b9954fbb4ef2 8.3.0 cited
-
Use Min() instead of min() in qsort, for consistency and to avoid
- b38900c76776 8.2.0 cited
-
pgindent run for 8.2.
- f99a569a2ee3 8.2.0 cited
-
Switch over to using our own qsort() all the time, as has been proposed
- 6edd2b4a91bd 8.2.0 cited
Robert Haas <robertmhaas@gmail.com> writes: > On Thu, Dec 1, 2011 at 10:48 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> I am thinking that the btree code, at least, would want to just >> unconditionally do >> >> colsortinfo->comparator(datum1, datum2, colsortinfo) >> >> so for an opclass that fails to supply the low-overhead comparator, >> it would insert into the "comparator" pointer a shim function that >> calls the opclass' old-style FCI-using comparator. (Anybody who >> complains about the added overhead would be told to get busy and >> supply a low-overhead comparator for their datatype...) But to do >> that, we have to have enough infrastructure here to cover all cases, >> so omitting collation or not having a place to stash an FmgrInfo >> won't do. > I'm slightly worried about whether that'll be adding too much overhead > to the case where there is no non-FCI comparator. But it may be no > worse than what we're doing now. It should be the same or better. Right now, we are going through FunctionCall2Coll to reach the FCI-style comparator. The shim function would be more or less equivalent to that, and since it's quite special purpose I would hope we could shave a cycle or two. For instance, we could probably afford to set up a dedicated FunctionCallInfo struct associated with the SortSupportInfo struct, and not have to reinitialize one each time. regards, tom lane