> Donc cela me semble assez clair. Soit tu as un bug chez toi, soit l'index
> scan ne fonctionne pas avec des tailles grandes, soit c'est un bug de
> la 7.x, soit c'est le nom du fichier. Je viens d'essayer, si
> l'index s'appelle tartempion ça marche aussi.
entre temps, je tatonne et j'en arrive à la conclusion qu'il n'utilise pas
les index quand l'index n'est pas unique. Mais il l'utilise s'il juge
que cela peut être utile par exemple dans le cas d'un tri:
sylex2000=> EXPLAIN SELECT * FROM sol_f order by id;
NOTICE: QUERY PLAN:
Index Scan using sol_f_id_idx on sol_f (cost=0.00..609741.97 rows=3908691 width=24)
EXPLAIN
par contre la même chose avec un where
sylex2000=> EXPLAIN SELECT * FROM sol_f where id=123123 ;
NOTICE: QUERY PLAN:
Seq Scan on sol_f (cost=0.00..77604.64 rows=39087 width=24)
EXPLAIN
un where et un order by:
sylex2000=> EXPLAIN SELECT * FROM sol_f where id=123123 order by id;
NOTICE: QUERY PLAN:
Sort (cost=81015.13..81015.13 rows=39087 width=24)
-> Seq Scan on sol_f (cost=0.00..77604.64 rows=39087 width=24)
EXPLAIN
> > semble-t-il indépendant du nom "Although you can use any name for the
> oui, mais il faut bien cependant stocker sol_f(id) quelque part (et aussi
> quel type d'index: BTREE, etc, cf man create_index (7l) chez moi)
par défaut c'est un BTREE . Donc l'index est bien pris en compte mais seulement
quand il le juge nécessaire!
Dans mon cas c'est assez simple
j'ai dans main_index_[d/f] dans sol_[d/f]
id | integer | unique ---> id | integer | pas unique
word | varchar(50) | ref | integer | (ref d'un
fichier)
lem | varchar(50) | sentpos | integer | (ref d'une
phrase)
pos | varchar(10) | wordpos | text |
j'ai pensé à cette config car ensuite je dois être capable de faire des requêtes du
style.
SELECT sol_f.ref,sol_f.sentpos,sol_f.wordpos,sol_d.wordpos FROM
main_index_f,sol_f,main_index_d,sol_d WHERE
main_index_f.word = 'emploi' AND main_index_d.word ='Stelle' AND
sol_f.ID=main_index_f.ID AND
sol_d.ID=main_index_d.ID AND
sol_d.ref=sol_f.ref AND sol_d.sentpos=sol_f.sentpos
Gilbert.
--
| UnixOnNous et Rejoignez le
Gilbert ROBERT | "Groupe des Utilisateurs Lémaniques de"
ISSCO, University of Geneva | / / (_)____ __ __ _ __
40 bd pont d'arve | / / / // __ \ / / / /| |/_/
CH-1211 GENEVA 4 | / /___ / // / / // /_/ /_> <
Tel: +41/22/705 8686 | /_____//_//_/ /_//_____/ /_/\_\
http://www.gilbert-robert.com | http://www.linux-gull.ch
--
http://www-internal.alphanet.ch/linux-leman/ avant de poser
une question.