Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Firebird e Interbase (https://www.clubdelphi.com/foros/forumdisplay.php?f=19)
-   -   Error al Crear INDICE... FIREBIRD/INTERBASE (https://www.clubdelphi.com/foros/showthread.php?t=27355)

Rogersito Plus 18-11-2005 01:52:17

Error al Crear INDICE... FIREBIRD/INTERBASE
 
Saludos... Estimados amigos de antemano gracias por sus comentarios y ayudas...
Trabajo con D7 - Interbase 6.5/Firebird 1.5 y para manejo de DB/Tablas/,,, con EMS IB Manager...

Mi dominio...:
CREATE DOMAIN VCHAR100 AS VARCHAR(100) CHARACTER SET ISO8859_1 COLLATE ES_ES
Mi Tabla DISTRITOS
...
NOMBRE varchar(100) NOT NULL
...

El Error: al momento de crear un indice para esa columna(NOMBRE).
CREATE INDEX IDX_DIST ON DISTRITOS(NOMBRE)
ops ERROR...!!!:o
fmSQLScript.Script:
This operation is not defined for system tables.unsuccessful metadata update.
key size too big for index IDX_DIST.

Por favor cual es el problema... en que falle hoy? :confused:
Gracias por sus ayudas...

jhonny 18-11-2005 02:11:55

Primero:

¿Porque creas un dominio llamado varchar100 y luego en lugar de usarlo usas varchar(100)?

Segundo:

Intenta cambiar
Código SQL [-]
CREATE INDEX IDX_DIST ON DISTRITOS(NOMBRE)

por
Código SQL [-]
ALTER TABLE DISTRITOS ADD CONSTRAINT PK_DISTRITOS PRIMARY KEY (NOMBRE);

Espero te sirva ;)

Casimiro Notevi 18-11-2005 09:35:01

Sacado el libro "The Firebird eBook":
Cita:

Limits
Firebird allows up to 256 user-created indexes per table in version 1.5 and higher, or
64 in lower releases. However, these are theoretical limits that are governed by both
page size and the actual on-disk size of the index description data on the index root
page. You could not store 256 indexes in a database with a page size smaller than 16KB.
On the index root page, each index needs 31 bytes for its identifier, space for descriptions
of each segment (column) involved in the index, and some bytes to store a pointer
to the first page of the index. Even a 16KB page may not be able to accommodate
256 indexes if there are more than a few compound indexes in the database.
To create indexes, a user must be authorized to connect to the database.
An index cannot exceed 253 bytes in total width. In reality, the number of bytes
may be significantly smaller. Factors that can reduce the number of actual “slots” available
to store characters include
• International character sets that use multiple bytes per character
• International character sets with complex uppercase/lowercase pairings and/or
dictionary sorting rules
• Use of non-binary collations
• Multiple segments (composite indexes) that require the addition of padding
bytes to retain the geometry of the index
In other words, using any character set except NONE will influence your decisions
about index design—particularly whether to use composite indexes. That’s the bad
315
news. The good news is that Firebird makes good use of single-column indexes in
multi-column searches and sorts, reducing the need for many multi-column indexes
that you might have experienced with another DBMS.
Por si acaso sirve de algo :)

Rogersito Plus 21-11-2005 03:49:05

Me quedo... con ISO8859_1
 
jhonny, gracias por responder... tienes razon en la declaracion de la tabla me olvide de utilizar el DOMINIO pero aun asi NO funciona... asi q la solucion que tuve es que mi DOMINIO será : CREATE DOMAIN VCHAR100 AS VARCHAR(100) CHARACTER SET ISO8859_1 COLLATE ISO8859_1, y funciona los INDICES... :D
Casimiro Notevi, gracias por los datos son muy interesantes...
Deberas muy agradecido de ambos... eh soy buenos...

MI GRAN DUDA AHORA ES COMO HAGO ESTE TIPO DE ORDEN...
A,B,C,D,....M,N,Ñ,O,P....X,Y,Z. ya que al utilizar CHARACTER SET ISO8859_1 COLLATE ISO8859_1, a los datos que empiezan con Ñ los manda al final del INDICE: A,B,C.......X,Y,Z,Ñ... y pues esto no me sirve...:o

Al González 04-01-2008 00:02:58

Disculpa por responder después de dos años :D.

Temo que tendrás que usar el ordenamiento ES_ES (español de España —y de muchos otros países—) para que te coloque la eñe entre la ene y la o. Yo acabo de reducir el campo de 100 a 80 para que me permita crear el índice en Firebird 1.5 (un caso muy similar al tuyo).

Un abrazo demorado.

Al González. :)

jachguate 04-01-2008 00:55:34

Cita:

Empezado por Al González (Mensaje 255859)
Disculpa por responder después de dos años :D.

Temo que tendrás que usar el ordenamiento ES_ES (español de España —y de muchos otros países—) para que te coloque la eñe entre la ene y la o. Yo acabo de reducir el campo de 100 a 80 para que me permita crear el índice en Firebird 1.5 (un caso muy similar al tuyo).

Un abrazo demorado.

Al González. :)

Solo comentar que la limitación de los 250 bytes para los indices ha sido superada en Firebird 2.0 y superiores.

Hasta luego.

;)

Al González 04-01-2008 01:02:29

Cita:

Empezado por jachguate (Mensaje 255864)
Solo comentar que la limitación de los 250 bytes para los indices ha sido superada en Firebird 2.0 y superiores.

Hasta luego.

;)

Excelente apunte. Algo así me dio a entender la siguiente página, que creo puede servir en casos como este.

http://www.volny.cz/iprenosil/interb...calculator.htm

Una ventaja más de Firebird 2 sobre 1.5. ;)

Un abrazo.

Al González. :)


La franja horaria es GMT +2. Ahora son las 07:51:35.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi