Re: Query does not use index
От | Martin Hampl |
---|---|
Тема | Re: Query does not use index |
Дата | |
Msg-id | A00A118A-9B58-11D8-91C4-000393674318@gmx.de обсуждение исходный текст |
Ответ на | Re: Query does not use index (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Query does not use index
|
Список | pgsql-novice |
Am 30.04.2004 um 17:52 schrieb Tom Lane: > It could be that this table has a lot of empty pages near the front, > which is a condition that's known to lead to underestimated row count > from ANALYZE. (Manfred is working on a better ANALYZE sampling method > that should avoid such errors in future.) Try doing a straight VACUUM > and see if the row count estimate gets better. It did! Thanks! Explain analyze now yields the following result: Explain analyze now QUERY PLAN ------------------------------------------------------------------------ ---------------------------------------------------------- Nested Loop (cost=0.00..70650.10 rows=12 width=32) (actual time=170.449..181.663 rows=3 loops=1) -> Index Scan using word_idx on token (cost=0.00..30403.79 rows=7621 width=16) (actual time=158.237..179.105 rows=5 loops=1) Index Cond: ((word)::text = 'FACTSHEET'::text) -> Index Scan using s_begin_idx on s (cost=0.00..5.27 rows=1 width=16) (actual time=0.429..0.434 rows=1 loops=5) Index Cond: ((s.text_id = "outer".text_id) AND (s."start" = "outer"."position")) Total runtime: 182.207 ms I never deleted anything from this database, but it might be that I dropped some of the tables a couple of times when populating the database. Also 'copy from' failed a couple of times. Can that have the same effect? Thanks again, Martin
В списке pgsql-novice по дате отправления: