Thread

Commits

  1. Add COSTS off to two EXPLAIN using tests.

  2. Change unknown-type literals to type text in SELECT and RETURNING lists.

  1. explain with costs in subselect.sql

    Andres Freund <andres@anarazel.de> — 2018-03-12T22:20:23Z

    Hi Tom, all,
    
    When forcing JITing to be enabled for all queries, obviously only useful
    for testing, I noticed that two explain outputs changed after I added
    explain support.
    
    The only differences come from:
    
    -- Unspecified-type literals in output columns should resolve as text
    
    SELECT *, pg_typeof(f1) FROM
      (SELECT 'foo' AS f1 FROM generate_series(1,3)) ss ORDER BY 1;
    
    -- ... unless there's context to suggest differently
    
    explain verbose select '42' union all select '43';
    explain verbose select '42' union all select 43;
    
    which don't use costs=off.  Is there a reason for that? I assume it was
    just a harmless oversight?
    
    Has been added in
    http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=1e7c4bb0049732ece651d993d03bb6772e5d281a
    
    Greetings,
    
    Andres Freund
    
    
    
  2. Re: explain with costs in subselect.sql

    Tom Lane <tgl@sss.pgh.pa.us> — 2018-03-12T22:25:42Z

    Andres Freund <andres@anarazel.de> writes:
    > When forcing JITing to be enabled for all queries, obviously only useful
    > for testing, I noticed that two explain outputs changed after I added
    > explain support.
    
    > The only differences come from:
    
    > -- Unspecified-type literals in output columns should resolve as text
    
    > SELECT *, pg_typeof(f1) FROM
    >   (SELECT 'foo' AS f1 FROM generate_series(1,3)) ss ORDER BY 1;
    
    > -- ... unless there's context to suggest differently
    
    > explain verbose select '42' union all select '43';
    > explain verbose select '42' union all select 43;
    
    > which don't use costs=off.  Is there a reason for that? I assume it was
    > just a harmless oversight?
    
    Duh, yeah, explain (verbose, costs off) would do fine there.
    Mea culpa.  Do you want to fix it?
    
    			regards, tom lane
    
    
    
  3. Re: explain with costs in subselect.sql

    Andres Freund <andres@anarazel.de> — 2018-03-12T22:28:07Z

    On 2018-03-12 18:25:42 -0400, Tom Lane wrote:
    > Andres Freund <andres@anarazel.de> writes:
    > > When forcing JITing to be enabled for all queries, obviously only useful
    > > for testing, I noticed that two explain outputs changed after I added
    > > explain support.
    > 
    > > The only differences come from:
    > 
    > > -- Unspecified-type literals in output columns should resolve as text
    > 
    > > SELECT *, pg_typeof(f1) FROM
    > >   (SELECT 'foo' AS f1 FROM generate_series(1,3)) ss ORDER BY 1;
    > 
    > > -- ... unless there's context to suggest differently
    > 
    > > explain verbose select '42' union all select '43';
    > > explain verbose select '42' union all select 43;
    > 
    > > which don't use costs=off.  Is there a reason for that? I assume it was
    > > just a harmless oversight?
    > 
    > Duh, yeah, explain (verbose, costs off) would do fine there.
    > Mea culpa.  Do you want to fix it?
    
    Yup, will do.
    
    Random aside: Noticed that we have *no* proper coverage of AND / OR
    behaviour of returning NULL if no element returns true. Will push
    something to add coverage, I've now manually retested that twice for
    JITing, which seems stupid.
    
    Greetings,
    
    Andres Freund