[firebird-support] Why when i create a Primary Key that is also a foreign key 2 index are created ?

2012-02-14 Thread nathanelrick
Hello,

Why when i create a Primary Key that is also a foreign key 2 index are created 
? or i make a mistake somewhere ?



[firebird-support] Re: Table where we add 2 000 000 rows everydays and delete them every night

2012-02-14 Thread nathanelrick

 You could use a sequence/generator for that without multi user problems and 
 very fast.
 

not really (but the idea is good), because i need also field like 
NB_database_update_by_user ... :( and in this way i will need to create as 
much sequence/generator than i have users (thousands of thousands) :(



Re: [firebird-support] Why when i create a Primary Key that is also a foreign key 2 index are created ?

2012-02-14 Thread unordained
-- Original Message ---
From: nathanelrick nathanelr...@yahoo.fr
 Why when i create a Primary Key that is also a foreign key 2 index are 
 created ? or i make a mistake somewhere ?
--- End of Original Message ---

http://www.firebirdsql.org/refdocs/langrefupd20-create-table.html#langrefupd20-ct-
using-index (see blue and red notes)

Correct. You cannot share an index between multiple index-using constraints, 
they 
each get their own. 

If you were to drop the primary key constraint, and the foreign key were 
re-using 
the primary key's unique index, you'd have a problem: the foreign key would 
need 
a non-unique index after the drop, or it would accidentally still be a unique 
foreign key [physical] even though no remaining constraint [logical] required 
it 
to be.

Going the other way, you'd have a primary key using a slight-less-efficient non-
unique index created by the foreign key, and it couldn't rely on the index 
itself 
to magically enforce the uniqueness of the primary key. The two concepts get 
tied 
together internally, such that using a unique index [physical] enforces the 
constraint [logical] -- AFAIK Firebird can't enforce a PK without a unique 
index, 
it doesn't have a backup mechanism that can use non-unique indices nor do a 
full-table-scan/sort/count...

While reference-counting might help in the few situations where multiple 
indexed 
constraints could share indices, I think the use cases for that are rather 
rare. 
Two unique constraints on the same field, or sharing the first few fields of 
their definition? Two foreign keys sharing one or several fields? (One being a 
superset of the other.) ... Pretty rare.

-Philip


[firebird-support] Firebird 1.5: How to tell the size of one table inside Fdb file?

2012-02-14 Thread Nando
Hi to all,

I have a Firebird 1.5 database that has grown up to 26.6 Gb. Most of the data 
is stored in one single table that holds a memo field. I'm worried about the 
size of this table, because as far as I know the maximun table size for version 
1.5 is about 36 Gb and I guess I'll soon get close to this limit.

How can I tell the size of a single table inside the Fdb file.

Thank your for any help.

Nando.




Re: [firebird-support] Firebird 1.5: How to tell the size of one table inside Fdb file?

2012-02-14 Thread Alexandre Benson Smith
Em 14/2/2012 22:46, Nando escreveu:
 Hi to all,

 I have a Firebird 1.5 database that has grown up to 26.6 Gb. Most of the data 
 is stored in one single table that holds a memo field. I'm worried about the 
 size of this table, because as far as I know the maximun table size for 
 version 1.5 is about 36 Gb and I guess I'll soon get close to this limit.

 How can I tell the size of a single table inside the Fdb file.

 Thank your for any help.

 Nando.



Look on the gstat output for the number of data pages and multiply it by 
your page size.

see you !


RE: [firebird-support] Firebird 1.5: How to tell the size of one table inside Fdb file?

2012-02-14 Thread Leyne, Sean

 I have a Firebird 1.5 database that has grown up to 26.6 Gb. Most of the data
 is stored in one single table that holds a memo field. I'm worried about the
 size of this table, because as far as I know the maximun table size for
 version 1.5 is about 36 Gb and I guess I'll soon get close to this limit.

I am 99.9% sure that the limit applies to data not counting blobs.

How many rows are in the table?


Sean



Re: [firebird-support] Firebird 1.5: How to tell the size of one table inside Fdb file?

2012-02-14 Thread Ann Harrison
Sean,


 I am 99.9% sure that the limit applies to data not counting blobs.

The limit on table size does not include the actual size of blobs, but
considers each blob to be eight bytes long.  Advance yourself to 100%
confident.

Cheers,

Ann


[firebird-support] what the most efficient way to do update or insert with value ?

2012-02-14 Thread nathanelrick
hello,

i want to do something like

update or insert into mytable(ID, amount) values (123, amount + 100);

how to do this ?



Re: [firebird-support] what the most efficient way to do update or insert with value ?

2012-02-14 Thread Alexandre Benson Smith
Em 15/2/2012 04:54, nathanelrick escreveu:
 hello,

 i want to do something like

 update or insert into mytable(ID, amount) values (123, amount + 100);

 how to do this ?


:)

Pretty hard to answer anything taking into account the information you 
provided