Subject | Table with more than 100 index. |
---|---|
Author | svanderclock |
Post date | 2009-12-07T10:38:45Z |
Hello,
I have a table with around 100 index. the index are mostly like
this
CREATE DESCENDING INDEX INDEX_1_1_IDX ON BIGTABLE_1 (Field1, Field2, Field3, field4, field5, Field6);
CREATE DESCENDING INDEX INDEX_1_9_IDX ON BIGTABLE_1 (Field1, Field2, Field3, field4, field5, Field7);
CREATE INDEX INDEX_1_9_IDX ON BIGTABLE_1 (Field1, Field2, Field3, field4, field5, Field8);
CREATE DESCENDING INDEX INDEX_1_9_IDX ON BIGTABLE_1 (Field2, Field3, Field1, field4, field5, Field6);
.....
in this table around 50 000 000 records (and 20 fields)
this index are motly here because we need to handle search and order for client in < 100 ms. so we need to index all possible case of search
first i receive an error when i try to add all the index (Index root page is full) and i have no other choice to duplicate the table in 3 differents tables (BIGTABLE_1, BIGTABLE_2 and BIGTABLE_3) to have an average of 33 index / tables. not ideal but in someway it's ok !
now i m facing another probleme : i try to put some reccords in the table and it's very very slow (more than 2 days now than the firebird is working and i insert only 2 000 000 records !)
* how to optimize it ?
* is it better to concat all my field in one "varchar" field to have an index only on A field instead of 5 or 6 fields ?
exemple:
field1 : aaaaz
field2 : 5
field1Plus2 : aaaaz|5
before : where field1 = 'aaaaz' and field2 = '5'
after : where field1Plus2 = 'aaaaz|5'
* is it better to increase the page size of the database (ie 8kb instead of 4 kb)
* any other idea ?
many thanks by advance
stephane
I have a table with around 100 index. the index are mostly like
this
CREATE DESCENDING INDEX INDEX_1_1_IDX ON BIGTABLE_1 (Field1, Field2, Field3, field4, field5, Field6);
CREATE DESCENDING INDEX INDEX_1_9_IDX ON BIGTABLE_1 (Field1, Field2, Field3, field4, field5, Field7);
CREATE INDEX INDEX_1_9_IDX ON BIGTABLE_1 (Field1, Field2, Field3, field4, field5, Field8);
CREATE DESCENDING INDEX INDEX_1_9_IDX ON BIGTABLE_1 (Field2, Field3, Field1, field4, field5, Field6);
.....
in this table around 50 000 000 records (and 20 fields)
this index are motly here because we need to handle search and order for client in < 100 ms. so we need to index all possible case of search
first i receive an error when i try to add all the index (Index root page is full) and i have no other choice to duplicate the table in 3 differents tables (BIGTABLE_1, BIGTABLE_2 and BIGTABLE_3) to have an average of 33 index / tables. not ideal but in someway it's ok !
now i m facing another probleme : i try to put some reccords in the table and it's very very slow (more than 2 days now than the firebird is working and i insert only 2 000 000 records !)
* how to optimize it ?
* is it better to concat all my field in one "varchar" field to have an index only on A field instead of 5 or 6 fields ?
exemple:
field1 : aaaaz
field2 : 5
field1Plus2 : aaaaz|5
before : where field1 = 'aaaaz' and field2 = '5'
after : where field1Plus2 = 'aaaaz|5'
* is it better to increase the page size of the database (ie 8kb instead of 4 kb)
* any other idea ?
many thanks by advance
stephane