db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: btree overflow during insert
Date Fri, 14 Nov 2008 10:07:08 GMT
Alan Burlison <Alan.Burlison@Sun.COM> writes:

> Knut Anders Hatlen wrote:
>
>> No, it shouldn't allocate more space than what is actually used by the
>> column. That probably means that reducing the declared length of the
>> varchar column won't help. I thought there was a mechanism that
>> automatically picked a larger page size at table/index creation time if
>> the table had long columns, but it may be that it only kicks in for
>> CLOBs and BLOBs.
>
> That's a shame :-(  We are going to give it a try in any case, just in
> case it does make a difference.
>
> The other thing we are doing is batching up the inserts using the JDBC
> addBatch functionality, but I assume that will have no relevance, as
> the index is being added after the inserts are complete.

Hmm... In the original post it looked like the errors happened while
processing the batch (the messages said "Error for batch element
#XX"). Are you sure that the index wasn't created implicitly before the
inserts were performed? Constraints in the table definition may create a
backing index even if CREATE INDEX hasn't been executed. In the example
below, CREATE TABLE creates an index to back the UNIQUE constraint, so
any inserts between CREATE TABLE and CREATE INDEX will still update a
B-tree.

ij> CREATE TABLE MY_TABLE(TEXT VARCHAR(4096) UNIQUE);
0 rows inserted/updated/deleted
ij> CREATE INDEX MY_INDEX ON MY_TABLE(TEXT);
0 rows inserted/updated/deleted
WARNING 01504: The new index is a duplicate of an existing index: SQL081114105207590.

-- 
Knut Anders

Mime
View raw message