You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kathey Marsden (Created) (JIRA)" <ji...@apache.org> on 2011/10/21 21:38:32 UTC

[jira] [Created] (DERBY-5473) Index growth can occur with update of ever increasing values i

Index growth can occur with update of ever increasing values i
--------------------------------------------------------------

                 Key: DERBY-5473
                 URL: https://issues.apache.org/jira/browse/DERBY-5473
             Project: Derby
          Issue Type: Bug
          Components: Store
            Reporter: Kathey Marsden


Attaching a reproduction for this issue ReproIdxGrowth.

The program has a single thread that iteratively updates 5 rows in a table with a time value.
 PreparedStatement ps = conn.prepareStatement(
        "UPDATE T SET LAST_SYNC_TIME = ?, NUM_SYNCS = ? WHERE ACCOUNT_ID = ?");

        ResultSet rs = s.executeQuery("SELECT ACCOUNT_ID, NUM_SYNCS FROM  T");
        while( rs.next()) {
            int account = rs.getInt(1);
            int prevNumSync = rs.getInt(1);
            ps.setLong(1, new Date().getTime());
            ps.setInt(2,prevNumSync++);
            ps.setInt(3, account);
            ps.executeUpdate();
        }

After 50,000 iterations we end up with 150 pages allocated for the just the 5 rows, possibly because it cannot get the table lock to rebalance the tree.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5473) Index growth can occur with update of ever increasing values

Posted by "Kathey Marsden (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-5473:
----------------------------------

              Urgency: Normal
    Affects Version/s: 10.9.0.0
                       10.8.2.3
                       10.7.1.4
                       10.6.2.3
                       10.5.3.2
    
> Index growth can occur with update of ever increasing values 
> -------------------------------------------------------------
>
>                 Key: DERBY-5473
>                 URL: https://issues.apache.org/jira/browse/DERBY-5473
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.2, 10.6.2.3, 10.7.1.4, 10.8.2.3, 10.9.0.0
>            Reporter: Kathey Marsden
>              Labels: derby_triage10_9
>         Attachments: ReproIdxGrowth.java
>
>
> On a table with an  BIGINT Index that is updated quickly with  every increasing values  the index can grow and space not be reclaimed.
> Attaching a reproduction for this issue ReproIdxGrowth.
> The program has a single thread that iteratively updates 5 rows in a table with a time value.
>  PreparedStatement ps = conn.prepareStatement(
>         "UPDATE T SET LAST_SYNC_TIME = ?, NUM_SYNCS = ? WHERE ACCOUNT_ID = ?");
>         ResultSet rs = s.executeQuery("SELECT ACCOUNT_ID, NUM_SYNCS FROM  T");
>         while( rs.next()) {
>             int account = rs.getInt(1);
>             int prevNumSync = rs.getInt(1);
>             ps.setLong(1, new Date().getTime());
>             ps.setInt(2,prevNumSync++);
>             ps.setInt(3, account);
>             ps.executeUpdate();
>         }
> After 50,000 iterations we end up with 150 pages allocated for the just the 5 rows, possibly because it cannot get the table lock to rebalance the tree.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5473) Index growth can occur with update of ever increasing values

Posted by "Kathey Marsden (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-5473:
----------------------------------

           Description: 
On a table with an  BIGINT Index that is updated quickly with  every increasing values  the index can grow and space not be reclaimed.

Attaching a reproduction for this issue ReproIdxGrowth.

The program has a single thread that iteratively updates 5 rows in a table with a time value.
 PreparedStatement ps = conn.prepareStatement(
        "UPDATE T SET LAST_SYNC_TIME = ?, NUM_SYNCS = ? WHERE ACCOUNT_ID = ?");

        ResultSet rs = s.executeQuery("SELECT ACCOUNT_ID, NUM_SYNCS FROM  T");
        while( rs.next()) {
            int account = rs.getInt(1);
            int prevNumSync = rs.getInt(1);
            ps.setLong(1, new Date().getTime());
            ps.setInt(2,prevNumSync++);
            ps.setInt(3, account);
            ps.executeUpdate();
        }

After 50,000 iterations we end up with 150 pages allocated for the just the 5 rows, possibly because it cannot get the table lock to rebalance the tree.


  was:
Attaching a reproduction for this issue ReproIdxGrowth.

The program has a single thread that iteratively updates 5 rows in a table with a time value.
 PreparedStatement ps = conn.prepareStatement(
        "UPDATE T SET LAST_SYNC_TIME = ?, NUM_SYNCS = ? WHERE ACCOUNT_ID = ?");

        ResultSet rs = s.executeQuery("SELECT ACCOUNT_ID, NUM_SYNCS FROM  T");
        while( rs.next()) {
            int account = rs.getInt(1);
            int prevNumSync = rs.getInt(1);
            ps.setLong(1, new Date().getTime());
            ps.setInt(2,prevNumSync++);
            ps.setInt(3, account);
            ps.executeUpdate();
        }

After 50,000 iterations we end up with 150 pages allocated for the just the 5 rows, possibly because it cannot get the table lock to rebalance the tree.


      Issue & fix info: High Value Fix,Repro attached
    Bug behavior facts: Seen in production
               Summary: Index growth can occur with update of ever increasing values   (was: Index growth can occur with update of ever increasing values i)
    
> Index growth can occur with update of ever increasing values 
> -------------------------------------------------------------
>
>                 Key: DERBY-5473
>                 URL: https://issues.apache.org/jira/browse/DERBY-5473
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>            Reporter: Kathey Marsden
>         Attachments: ReproIdxGrowth.java
>
>
> On a table with an  BIGINT Index that is updated quickly with  every increasing values  the index can grow and space not be reclaimed.
> Attaching a reproduction for this issue ReproIdxGrowth.
> The program has a single thread that iteratively updates 5 rows in a table with a time value.
>  PreparedStatement ps = conn.prepareStatement(
>         "UPDATE T SET LAST_SYNC_TIME = ?, NUM_SYNCS = ? WHERE ACCOUNT_ID = ?");
>         ResultSet rs = s.executeQuery("SELECT ACCOUNT_ID, NUM_SYNCS FROM  T");
>         while( rs.next()) {
>             int account = rs.getInt(1);
>             int prevNumSync = rs.getInt(1);
>             ps.setLong(1, new Date().getTime());
>             ps.setInt(2,prevNumSync++);
>             ps.setInt(3, account);
>             ps.executeUpdate();
>         }
> After 50,000 iterations we end up with 150 pages allocated for the just the 5 rows, possibly because it cannot get the table lock to rebalance the tree.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5473) Index growth can occur with update of ever increasing values i

Posted by "Kathey Marsden (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-5473:
----------------------------------

    Attachment: ReproIdxGrowth.java
    
> Index growth can occur with update of ever increasing values i
> --------------------------------------------------------------
>
>                 Key: DERBY-5473
>                 URL: https://issues.apache.org/jira/browse/DERBY-5473
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>            Reporter: Kathey Marsden
>         Attachments: ReproIdxGrowth.java
>
>
> Attaching a reproduction for this issue ReproIdxGrowth.
> The program has a single thread that iteratively updates 5 rows in a table with a time value.
>  PreparedStatement ps = conn.prepareStatement(
>         "UPDATE T SET LAST_SYNC_TIME = ?, NUM_SYNCS = ? WHERE ACCOUNT_ID = ?");
>         ResultSet rs = s.executeQuery("SELECT ACCOUNT_ID, NUM_SYNCS FROM  T");
>         while( rs.next()) {
>             int account = rs.getInt(1);
>             int prevNumSync = rs.getInt(1);
>             ps.setLong(1, new Date().getTime());
>             ps.setInt(2,prevNumSync++);
>             ps.setInt(3, account);
>             ps.executeUpdate();
>         }
> After 50,000 iterations we end up with 150 pages allocated for the just the 5 rows, possibly because it cannot get the table lock to rebalance the tree.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira