Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 27th, 2011, 09:20 AM
DaleCooper DaleCooper is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2011
Posts: 6 DaleCooper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 41 sec
Reputation Power: 0
Key size too big for index

Hello everybody!!


I was trying to define the index for my table PRODUCTS using theese fields:

COMPANY_CODE VARCHAR (2)
REF_NUMBER VARCHAR (256)

COMPANY_CODE VARCHAR (2)

and i can't because this error


SEVERE 27/07/11 15:36:liquibase: Error executing SQL ALTER TABLE PRODUCTS ADD CONSTRAINT PRODUCTS_PK PRIMARY KEY (COMPANY_CODE, REF_NUMBER)
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544351. unsuccessful metadata update

My database has utf8 charset and has a page size of 16384

According to volny index calculator:

i could create this index:

Number of columns 2
Total key size 1292
Remains 2800

¿Why can't i do it?


Regards

Reply With Quote
  #2  
Old July 27th, 2011, 10:17 AM
clivew clivew is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 2,045 clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
Quote:
Originally Posted by DaleCooper
Hello everybody!!


I was trying to define the index for my table PRODUCTS using theese fields:

COMPANY_CODE VARCHAR (2)
REF_NUMBER VARCHAR (256)

COMPANY_CODE VARCHAR (2)

and i can't because this error


SEVERE 27/07/11 15:36:liquibase: Error executing SQL ALTER TABLE PRODUCTS ADD CONSTRAINT PRODUCTS_PK PRIMARY KEY (COMPANY_CODE, REF_NUMBER)
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544351. unsuccessful metadata update

My database has utf8 charset and has a page size of 16384

According to volny index calculator:

i could create this index:

Number of columns 2
Total key size 1292
Remains 2800

¿Why can't i do it?


Regards

I think you need to post the current DDL for the table as reported by Firebird

Reply With Quote
  #3  
Old July 28th, 2011, 01:44 AM
DaleCooper DaleCooper is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2011
Posts: 6 DaleCooper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 41 sec
Reputation Power: 0
The isql with the sql output is this:

isql

connect INVENT.FDB user 'XXX' password 'XXX';

SQL> ALTER TABLE PRODUCTS ADD CONSTRAINT PRODUCTS_PK PRIMARY KEY (COMPANY_CODE, REF_NUMBER)
Statement failed, SQLCODE = -607

unsuccessful metadata update
-key size too big for index PRODUCTS
SQL>

Reply With Quote
  #4  
Old July 28th, 2011, 02:55 AM
mIRCata mIRCata is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Location: Plovdiv. Bulgaria
Posts: 200 mIRCata User rank is Corporal (100 - 500 Reputation Level)mIRCata User rank is Corporal (100 - 500 Reputation Level)mIRCata User rank is Corporal (100 - 500 Reputation Level)mIRCata User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 6 h 50 m 14 sec
Reputation Power: 11
Quote:
Originally Posted by DaleCooper
The isql with the sql output is this:

isql

connect INVENT.FDB user 'XXX' password 'XXX';

SQL> ALTER TABLE PRODUCTS ADD CONSTRAINT PRODUCTS_PK PRIMARY KEY (COMPANY_CODE, REF_NUMBER)
Statement failed, SQLCODE = -607

unsuccessful metadata update
-key size too big for index PRODUCTS
SQL>


Not how you connect to the database - @clivew wants the table structure- i.e CREATE TABLE PRODUCTS ( .....

Reply With Quote
  #5  
Old July 28th, 2011, 02:56 AM
mIRCata mIRCata is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Location: Plovdiv. Bulgaria
Posts: 200 mIRCata User rank is Corporal (100 - 500 Reputation Level)mIRCata User rank is Corporal (100 - 500 Reputation Level)mIRCata User rank is Corporal (100 - 500 Reputation Level)mIRCata User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 6 h 50 m 14 sec
Reputation Power: 11
Quote:
Originally Posted by DaleCooper
The isql with the sql output is this:

isql

connect INVENT.FDB user 'XXX' password 'XXX';

SQL> ALTER TABLE PRODUCTS ADD CONSTRAINT PRODUCTS_PK PRIMARY KEY (COMPANY_CODE, REF_NUMBER)
Statement failed, SQLCODE = -607

unsuccessful metadata update
-key size too big for index PRODUCTS
SQL>


Not how you connect to the database - @clivew wants the table structure- i.e CREATE TABLE PRODUCTS (Fields, data types etc)

Reply With Quote
  #6  
Old July 28th, 2011, 03:16 AM
DaleCooper DaleCooper is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2011
Posts: 6 DaleCooper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 41 sec
Reputation Power: 0
The create table sql is t:

create table PRODUCTS
(
COMPANY_CODE VARCHAR(2) not NULL,
REF_NUMBER VARCHAR(256) not NULL,
DESC VARCHAR(100),
);

Reply With Quote
  #7  
Old July 28th, 2011, 03:53 PM
clivew clivew is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 2,045 clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
You are still not posting the FULL DDL for the table (with all its constraints etc.) as REPORTED BY Firebird.

I can tell this because:
1. What you posted would not compile due to the comma before the closing paren.
2. There is no mention of the PRODUCTS index referenced in your error message.

Trust me, we are not just being picky to make your life difficult.
We give of our time freely and we need to know what Firebird itself reports NOT what you think you instructed it to create in order to use our time wisely.

Clive

Reply With Quote
  #8  
Old July 29th, 2011, 02:08 AM
DaleCooper DaleCooper is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2011
Posts: 6 DaleCooper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 41 sec
Reputation Power: 0
Sorry , i have made the two mistakes writing the ddl sentences due to have been copied by hand.

The complete ddl sentences are theese:

create table PRODUCTS
(
COMPANY_CODE VARCHAR(2) not NULL,
REF_NUMBER VARCHAR(256) not NULL,
DESC VARCHAR(100)
);

ALTER TABLE PRODUCTS ADD CONSTRAINT PRODUCTS_PK PRIMARY KEY (COMPANY_CODE, REF_NUMBER)

Statement failed, SQLCODE = -607

unsuccessful metadata update
-key size too big for index PRODUCTS_PK

The table has not more constraints, only this pk.

Regards.

Reply With Quote
  #9  
Old July 29th, 2011, 03:07 AM
DaleCooper DaleCooper is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2011
Posts: 6 DaleCooper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 41 sec
Reputation Power: 0
Sorry , i have made the two mistakes writing the ddl sentences due to have been copied by hand.

The complete ddl sentences are theese:

create table PRODUCTS
(
COMPANY_CODE VARCHAR(2) not NULL,
REF_NUMBER VARCHAR(256) not NULL,
DESC VARCHAR(100)
);

ALTER TABLE PRODUCTS ADD CONSTRAINT PRODUCTS_PK PRIMARY KEY (COMPANY_CODE, REF_NUMBER)

Statement failed, SQLCODE = -607

unsuccessful metadata update
-key size too big for index PRODUCTS_PK

The table has not more constraints, only this pk.

Regards.

Reply With Quote
  #10  
Old July 29th, 2011, 04:15 AM
mariuz's Avatar
mariuz mariuz is offline
Bug Hunter
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Transylvania (Romania)
Posts: 309 mariuz User rank is Sergeant (500 - 2000 Reputation Level)mariuz User rank is Sergeant (500 - 2000 Reputation Level)mariuz User rank is Sergeant (500 - 2000 Reputation Level)mariuz User rank is Sergeant (500 - 2000 Reputation Level)mariuz User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 9 h 38 m 4 sec
Reputation Power: 22
tested and works

Quote:
Originally Posted by DaleCooper
Sorry , i have made the two mistakes writing the ddl sentences due to have been copied by hand.

The complete ddl sentences are theese:

create table PRODUCTS
(
COMPANY_CODE VARCHAR(2) not NULL,
REF_NUMBER VARCHAR(256) not NULL,
DESC VARCHAR(100)
);

ALTER TABLE PRODUCTS ADD CONSTRAINT PRODUCTS_PK PRIMARY KEY (COMPANY_CODE, REF_NUMBER)

Statement failed, SQLCODE = -607

unsuccessful metadata update
-key size too big for index PRODUCTS_PK

The table has not more constraints, only this pk.

Regards.


I have tested and it works on firebird 2.5 page size 16384
with db UTF-8

ODS Version 11.2
Page Size 16384
Pages 153
Size on Disk 2.39MB
SQL Dialect 3
Default Character Set UTF8

https://gist.github.com/1113493

Please do a backup restore and check if it works after that
ps: also according to index calculator should be enough space for the index
http://www.volny.cz/iprenosil/inter...xcalculator.htm
__________________
My home page: http://www.firebirdsql.org and work place :http://www.reea.net

Reply With Quote
  #11  
Old July 29th, 2011, 04:46 AM
DaleCooper DaleCooper is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2011
Posts: 6 DaleCooper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 41 sec
Reputation Power: 0
I know what is happening:

I am using latest fyracle version which is based in firebird 1.5 version.

I though this fyracle version was based in latest firebird version (2.5) and it is not true.

Whith the 1.5 version and according to wolny index key size calculator the index is too big.

Thanks to all for the help and time used.

Reply With Quote
  #12  
Old July 29th, 2011, 01:23 PM
clivew clivew is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 2,045 clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
Quote:
I know what is happening:

Glad to hear you are up and running.

No doubt you will now understand the importance of giving us a complete picture when soliciting our help.

I don't believe you ever mentioned fyracle and your failure to cut/paste information we requested accurately
led us down some blind alleys.

This is not a complaint; just a lesson for anyone who reads this post about the importance of
giving us a complete context to get a rapid solution.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Key size too big for index

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap