Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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 August 2nd, 2005, 12:46 AM
arav arav is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 4 arav User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m 19 sec
Reputation Power: 0
Size restriction for primary key ?

I tried to create the below table in firebird database,

create table KD (H_ID integer not null,WORD varchar(200),URL_ID integer not null,WORDCOUNT integer,PRIMARY KEY(H_ID,WORD,URL_ID));

I get the following error,

Statement failed, SQLCODE = -607
unsuccessful metadata update
-key size too big for index RDB$PRIMARY77


Is there any size restriction for primary key in firebird?

Reply With Quote
  #2  
Old August 2nd, 2005, 02:14 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,906 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 7 h 8 m 35 sec
Reputation Power: 279
Yes there are, see this basically for Firebird up to 1.5.2 is 252 bytes and for Firebird 2 is 1/4 of the page size, or a maximum of 4Kb.
Anyway I don't think that adding a varchar(200) to a primary key is a good idea.

Reply With Quote
  #3  
Old August 2nd, 2005, 02:47 AM
fikret fikret is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 111 fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 5 h 32 m 11 sec
Reputation Power: 8
Quote:
Originally Posted by pabloj
Anyway I don't think that adding a varchar(200) to a primary key is a good idea.


Yes, that's NOT VERY good idea...

--
Best regards,
Fikret Hasovic http://fikret.fbtalk.net
USAID TAMP Senior Programmer

* Firebird Foundation member.
- Join today at http://www.firebirdsql.org/ff/foundation
* JEDI VCS contributor
http://jedivcs.sourceforge.net/
* Firebird and Fyracle news
http://www.fyracle.org

Reply With Quote
  #4  
Old August 3rd, 2005, 03:39 AM
SilverDB's Avatar
SilverDB SilverDB is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Romania
Posts: 173 SilverDB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 45 m 53 sec
Reputation Power: 5
Send a message via Yahoo to SilverDB
Try creating the PRIMARY KEY on H_ID and after that create an INDEX on (H_ID,WORD,URL_ID)
__________________
If i've been helpful, please add to my reputation.
My unfinished site: http://www.dever.ro

Reply With Quote
  #5  
Old August 3rd, 2005, 03:47 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,906 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 7 h 8 m 35 sec
Reputation Power: 279
BTW: WORD must be NOT NULL to be part of a PK

Reply With Quote
  #6  
Old May 7th, 2006, 07:04 AM
cforce cforce is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 1 cforce User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 46 sec
Reputation Power: 0
As you see below i also have problems with the index size.
Using UNICODE_FSS i get index size of 1612.
I set Page (FB2) size to max 16384 but still get the error message "key size too big for index PK_FILEONVOLUME"
Please help!

--cut--
CREATE TABLE FILEONVOLUME (
VOLUMESERIAL VARCHAR(20) NOT NULL,
MD5 VARCHAR(33) NOT NULL,
RELATIVEPATH VARCHAR(200) NOT NULL,
FILENAME VARCHAR(160) NOT NULL,
EXTENSION VARCHAR(5) NOT NULL,
FILELASTMODIFYTIME NUMERIC(18,0) NOT NULL,
FILELASTACCESSTIME NUMERIC(18,0) NOT NULL,
FILESIZE NUMERIC(18,0) NOT NULL,
REC_VERSION_MODIFIED NUMERIC(18,0),
REC_DATE_MODIFIED DOUBLE PRECISION);

ALTER TABLE FILEONVOLUME ADD CONSTRAINT PK_FILEONVOLUME PRIMARY KEY (MD5, VOLUMESERIAL, RELATIVEPATH, FILENAME, EXTENSION);

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Size restriction for primary key ?


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT