>>>>> "Ondrej" == Ondrej Koala Vacha <koala@stripped> writes:
Ondrej> Description:
Ondrej> I have two tables:
Ondrej> table rows
Ondrej> polozky 363157
Ondrej> doklady 16325
Ondrej> and sql statement:
Ondrej> select sum(polozky.cena) from polozky,doklady where
> polozky.doklad=doklady.faktura
Ondrej> after explain:
Ondrej> table type possible_keys key key_len ref rows Extra
Ondrej> doklady index faktura faktura 10 NULL 16325 Using index
Ondrej> polozky ref doklad doklad 10 doklady.faktura 26
Ondrej> time of select:
Ondrej> sum(polozky.cena)
Ondrej> 30914400.90
Ondrej> real 0m12.694s
Ondrej> user 0m0.020s
Ondrej> sys 0m0.010s
Ondrej> $ myisamchk bondtest23/polozky
Ondrej> Checking MYISAM file: bondtest23/polozky
Ondrej> Data records: 363157 Deleted blocks: 0
Ondrej> - check file-size
Ondrej> - check key delete-chain
Ondrej> - check record delete-chain
Ondrej> - check index reference
Ondrej> - check data record references index: 1
Ondrej> - check data record references index: 2
Ondrej> $ myisamchk bondtest23/doklady
Ondrej> Checking MYISAM file: bondtest23/doklady
Ondrej> Data records: 16325 Deleted blocks: 0
Ondrej> - check file-size
Ondrej> - check key delete-chain
Ondrej> - check record delete-chain
Ondrej> - check index reference
Ondrej> - check data record references index: 1
Ondrej> - check data record references index: 2
Ondrej> - check data record references index: 3
Ondrej> explain:
Ondrej> table type possible_keys key key_len ref rows Extra
Ondrej> doklady index faktura faktura 10 NULL 16325 Using index
Ondrej> polozky ALL doklad NULL NULL NULL 363157 where used
Ondrej> and time of select is now infinite
Hi!
Could you mail me the output of:
myisamchk -dvv bondtest23/polozky
I assume that the rec/key value is wrong (I just fixed this for 3.23.2)
You can probably fix this by doing:
myisamchk -a bondtest23/polozky
Regards,
Monty