db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristian Waagan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5294) Enhance compress table to drop and recreate the triggers. This will enable pre-10.9 triggers (after hard upgrade to 10.9) to read only the required columns from the trigger table.
Date Thu, 30 Jun 2011 18:20:28 GMT

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

Kristian Waagan commented on DERBY-5294:
----------------------------------------

I'm not sure we have consensus yet. This far I see the following suggestions on the table:
 a) do work in compress
 b) do work in upgrade, requires getting access to the lcc (connecting)
 c) add a specific system procedure
 d) manual drop/create triggers

My reason for suggesting c) was the same reason that Mike used to justify adding the trigger
recreation to compress table - it's heavy weight. Given that d) would work for users who find
compress table too heavy weight, I'm fine with scrapping option c) (it does add more code
to maintain, and it probably won't be used much).
That leaves option a) and b), and without having studied this in detail, I lean towards b)
because it seems like the natural place to do it. It would be interesting to see how much
work is required to get that working.
If b) turns out to be too much work, or is otherwise infeasible, we can always return to to
option a) - we already have the code outlined (thanks Mamta). In that case I'd make sure we
update the documentation such that users know what happens when they run compress table, and
maybe make it even clearer how running compress table affects a running system.

As a side note, are there any drawbacks/risks to "fixing triggers" unconditionally in compress
table?

> Enhance compress table to drop and recreate the triggers. This will enable pre-10.9 triggers
(after hard upgrade to 10.9) to read only the required columns from the trigger table.
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5294
>                 URL: https://issues.apache.org/jira/browse/DERBY-5294
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.9.0.0
>            Reporter: Mamta A. Satoor
>         Attachments: DERBY5289_alltriggers_06282011_diff.txt, DERBY5289_alltriggers_06282011_stat.txt
>
>
> Triggers created prior to 10.9 release will continue to read all the columns from trigger
table even after database has been upgraded to 10.9 and higher. Which in another words means
that such triggers will not benefit from work done for DERBY-1482.
> With DERBY-1482 (which went in 10.9 codeline), triggers will read only the columns needed
by the triggering sql and firing triggers. But this applies only to triggers created in 10.9
and higher. Any triggers created prior to 10.9 will not be able to take advantage of DERBY-1482
because those triggers do not keep the information about the trigger action columns. Currently,
the users will have to drop and recreate the triggers which use the REFERENCING CLAUSE and
were created prior to 10.9 to take advantage of DERBY-1482.
> The alternative to manual drop and recreate of such triggers can be explored as part
of this jira. Couple options are
> 1)UPDATE sql should detect that the trigger does not have information about the trigger
action columns and hence it should make the trigger collect that information.
> 2)At the time of upgrade, when we mark all the SPSes invalid, detect the triggers which
do not have the information about the trigger action columns and make those triggers collect
that information.
> 3)Enhance ALTER TABLE COMPRESS to detect the triggers which do not have the information
about the trigger action columns and make those triggers collect that information. With this
option, users will still have to manually do ALTER TABLE COMPRESS to fix the triggers but
atleast they won't have to get the original trigger definitions and drop and recreate the
triggers using those original trigger definitions.
> 10.9 currently does not have central place where the trigger will go and collect the
information about trigger action columns. We do have code in ALTER TABLE DROP COLUMN to collect
the trigger action column info but it will probably better to have such a code in TriggerDescriptor
so it can be used by the approach taken to fix this jira.
> Note that without the fix for this jira, the triggers created prior to 10.9 will work
just fine after upgrade to 10.9 and higher but they will not be able to prevent reading of
columns that are not necessary for the triggering sql and firing triggers

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message