Thread

  1. How to prohibit parallel scan through tableam?

    Konstantin Knizhnik <k.knizhnik@postgrespro.ru> — 2019-11-27T11:33:42Z

    Hi hackers,
    
    I wonder how it is possible to prohibit parallel scan for the external 
    storage accessed through tableam?
    For example if I want to implement specialized tableam for fast access 
    to temp tables, how can I inform optimizer that
    parallel scan is not possible (because table data is local to the backend)?
    
    Thanks in advance,
    
    -- 
    Konstantin Knizhnik
    Postgres Professional: http://www.postgrespro.com
    The Russian Postgres Company
    
    
    
    
    
  2. Re: How to prohibit parallel scan through tableam?

    Rafia Sabih <rafia.pghackers@gmail.com> — 2019-11-27T12:12:35Z

    On Wed, 27 Nov 2019 at 12:33, Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
    wrote:
    
    > Hi hackers,
    >
    > I wonder how it is possible to prohibit parallel scan for the external
    > storage accessed through tableam?
    > For example if I want to implement specialized tableam for fast access
    > to temp tables, how can I inform optimizer that
    > parallel scan is not possible (because table data is local to the backend)?
    >
    >  How about setting parallel_setup_cost to disable_cost in costsize.c for
    your specific scan method.
    
    -- 
    Regards,
    Rafia Sabih
    
  3. Re: How to prohibit parallel scan through tableam?

    Konstantin Knizhnik <k.knizhnik@postgrespro.ru> — 2019-11-27T13:10:20Z

    
    On 27.11.2019 15:12, Rafia Sabih wrote:
    >
    >
    > On Wed, 27 Nov 2019 at 12:33, Konstantin Knizhnik 
    > <k.knizhnik@postgrespro.ru <mailto:k.knizhnik@postgrespro.ru>> wrote:
    >
    >     Hi hackers,
    >
    >     I wonder how it is possible to prohibit parallel scan for the
    >     external
    >     storage accessed through tableam?
    >     For example if I want to implement specialized tableam for fast
    >     access
    >     to temp tables, how can I inform optimizer that
    >     parallel scan is not possible (because table data is local to the
    >     backend)?
    >
    >  How about setting parallel_setup_cost to disable_cost in costsize.c 
    > for your specific scan method.
    
    How can I do it if i just implementing my AM and not going to change any 
    postgres code?
    
    -- 
    Konstantin Knizhnik
    Postgres Professional: http://www.postgrespro.com
    The Russian Postgres Company
    
    
  4. Re: How to prohibit parallel scan through tableam?

    Rafia Sabih <rafia.pghackers@gmail.com> — 2019-11-28T13:23:21Z

    On Wed, 27 Nov 2019 at 12:33, Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
    wrote:
    
    > Hi hackers,
    >
    > I wonder how it is possible to prohibit parallel scan for the external
    > storage accessed through tableam?
    > For example if I want to implement specialized tableam for fast access
    > to temp tables, how can I inform optimizer that
    > parallel scan is not possible (because table data is local to the backend)?
    >
    > One moment, isn't that parallel scans are already restricted for temp
    tables, or I have misunderstood something here...?
    
    
    
    -- 
    Regards,
    Rafia Sabih
    
  5. Re: How to prohibit parallel scan through tableam?

    Andres Freund <andres@anarazel.de> — 2019-12-03T21:22:17Z

    Hi,
    
    On 2019-11-27 14:33:42 +0300, Konstantin Knizhnik wrote:
    > I wonder how it is possible to prohibit parallel scan for the external
    > storage accessed through tableam?
    > For example if I want to implement specialized tableam for fast access to
    > temp tables, how can I inform optimizer that
    > parallel scan is not possible (because table data is local to the backend)?
    
    I don't think there currently is a good way to do so - but it shouldn't
    be hard to add that capability.
    
    Greetings,
    
    Andres Freund
    
    
    
    
  6. Re: How to prohibit parallel scan through tableam?

    Andres Freund <andres@anarazel.de> — 2019-12-03T21:24:14Z

    Hi,
    
    On 2019-11-27 16:10:20 +0300, Konstantin Knizhnik wrote:
    > On 27.11.2019 15:12, Rafia Sabih wrote:
    > > On Wed, 27 Nov 2019 at 12:33, Konstantin Knizhnik
    > > <k.knizhnik@postgrespro.ru <mailto:k.knizhnik@postgrespro.ru>> wrote:
    > > 
    > >     Hi hackers,
    > > 
    > >     I wonder how it is possible to prohibit parallel scan for the
    > >     external
    > >     storage accessed through tableam?
    > >     For example if I want to implement specialized tableam for fast
    > >     access
    > >     to temp tables, how can I inform optimizer that
    > >     parallel scan is not possible (because table data is local to the
    > >     backend)?
    > > 
    > >  How about setting parallel_setup_cost to disable_cost in costsize.c for
    > > your specific scan method.
    > 
    > How can I do it if i just implementing my AM and not going to change any
    > postgres code?
    
    I think a set_rel_pathlist hook that prevents parallel paths from being
    considered would be your best bet for now. But I encourage you to
    suggest a patch to tableam to support it properly in future releases.
    
    Greetings,
    
    Andres Freund