db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6109) Allow CREATE SYNONYM for table function invocations.
Date Fri, 22 Mar 2013 12:03:15 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6109?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13610181#comment-13610181

Rick Hillegas commented on DERBY-6109:

A typical wrapper view looks like this:

  create view v as select * from ...

When you use the view in the following query...

  select a from v

...the projection which the optimizer pushes down to the table element (base table or table
function) is...

  select *

...but you want the optimizer to push down this projection instead...

  select a

If you used a synonym instead, I'm supposing that the synonym would be replaced with the reference
to the table element at bind() time, before the optimizer sees the query. The optimizer would
only see "select a" and not "select *", so "select a" would be pushed down.

Note that I haven't verified that that's what happens with table synonyms today. In the long
run, what we really want to do is fix DERBY-6036.
> Allow CREATE SYNONYM for table function invocations.
> ----------------------------------------------------
>                 Key: DERBY-6109
>                 URL: https://issues.apache.org/jira/browse/DERBY-6109
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions:
>            Reporter: Rick Hillegas
> SYNONYMs are a non-standard extension supported by many databases. See DERBY-335. Right
now SYNONYMs are only allowed for tables and views. It would be useful (and should be easy)
to extend this feature to support SYNONYMs for table function invocations. E.g.:
> CREATE SYNONYM LT0_P for TABLE( LT0('with_provenance') )
> See the discussion of this topic on this email thread: http://apache-database.10148.n7.nabble.com/Limitations-of-Table-Functions-vs-old-VTIs-td127988.html

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message