Re: [HACKERS] Do we need the gcc feature "__builtin_expect" to promote the branches prediction?

2017-06-05 Thread Hao Lee
n Fri, Jun 2, 2017 at 11:32 PM, Andres Freund <and...@anarazel.de> wrote: > Hi, > > On 2017-06-02 16:40:56 +0800, Hao Lee wrote: > > Hi all, > >There is a lot of "if statement" in system, and GCC provides a > > feature,"__builtin_expect

Re: [HACKERS] Do we need the gcc feature "__builtin_expect" to promote the branches prediction?

2017-06-02 Thread Hao Lee
Okay. Thanks On Fri, Jun 2, 2017 at 7:27 PM, Julien Rouhaud <julien.rouh...@dalibo.com> wrote: > On 02/06/2017 12:50, Craig Ringer wrote: > > > > > > On 2 Jun. 2017 16:42, "Hao Lee" <mixt...@gmail.com > > <mailto:mixt...@gmail.com>> w

[HACKERS] Do we need the gcc feature "__builtin_expect" to promote the branches prediction?

2017-06-02 Thread Hao Lee
Hi all, There is a lot of "if statement" in system, and GCC provides a feature,"__builtin_expect", which let compilers know which branch is mostly run. as we known, miss-prediction will lead the performance lost(because the CPU will thrown away some instructions, and re-fetch some new

Re: [HACKERS] Do we need use more meaningful variables to replace 0 in catalog head files?

2016-11-08 Thread Hao Lee
e: > > On Tue, Nov 8, 2016 at 10:57 AM, Hao Lee <mixt...@gmail.com> wrote: > >> It's a tedious work to figure out these numbers real meaning. for > example, > >> if i want to know the value of '71' represent what it is. I should go > back > >> to refer

[HACKERS] Do we need use more meaningful variables to replace 0 in catalog head files?

2016-11-07 Thread Hao Lee
Hi guys, Although, usually, we do not change the system catalog or modify the catalog schema, or adding a new system catalog, but in these system catalog head files, such as pg_xxx.h, i think we should use more meaningful variables. As we known, in pg_xxx.h files, we insert some initial values

[HACKERS] Does "explain (QueryTree [RAW| ANAYLZE|REWRITE] | Optimization [PULL_UP_BEFORE| PULL_UP_AFTER|...]) SELECT XXXX" helpful?

2016-05-21 Thread Hao Lee
Hi all, When we debugging or hacking the internal, the tedious things is to debug step by step the code, so that make sure the PostgreSQL generates the right raw syntax tree or query tree or the plans. Therefore, i think if we have a uitility statment to show that, such as, we can using the

[HACKERS] It's seems that the function "do_text_output_multiline" does not suit for format "line1\nline2\n...lineN".

2016-05-20 Thread Hao Lee
Hi all, Today, I am do some works on adding some customized featues to PostgreSQL 9.6 beta1. But, when i do some output to psql using the fuction "do_text_output_multiline" with the string just like mentioned in mail tilte, such as "this is a\ntest for\nnew blank.". the PostgreSQL may lead to