I have Server running on Windows XP using PostgreSQL 8.1.4 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special) Db size is 862 MB 8 users Bigger tables: 1 1214 pg_shdepend 775 MB 2 1232 pg_shdepend_depender_index 285 MB 3 19701 rid 234 MB 4 19301 bilkaib 170 MB 5 1233 pg_shdepend_reference_index 156 MB 6 19335 dok 146 MB Sometimes simple query explain SELECT dokumnr FROM DOK where dokumnr IN (110774) AND ( dokumnr IN (SELECT dokumnr FROM bilkaib WHERE alusdok='LY' AND masin LIKE 'a%') ) "Nested Loop IN Join (cost=0.00..8.51 rows=1 width=4)" " -> Index Scan using dok_dokumnr_idx on dok (cost=0.00..4.81 rows=1 width=4)" " Index Cond: (dokumnr = 110774)" " -> Index Scan using bilkaib_dokumnr_idx on bilkaib (cost=0.00..44.26 rows=12 width=4)" " Index Cond: (dokumnr = 110774)" " Filter: ((alusdok = 'LY'::bpchar) AND (masin ~~ 'a%'::text))" takes 34 seconds. Tables are indexed and logfile shows autovacuum running. I ran VACUUM ANALYZE. It returns INFO: free space map contains 22501 pages in 77 relations DETAIL: A total of 20000 page slots are in use (including overhead). 111216 page slots are required to track all free space. Current limits are: 20000 page slots, 1000 relations, using 186 KB. NOTICE: number of page slots needed (111216) exceeds max_fsm_pages (20000) HINT: Consider increasing the configuration parameter "max_fsm_pages" to a value over 111216. Query returned successfully with no result in 201099 ms. How to speed up this query ? Should I set max_fsm_pages to a 113000 or other suggestions ? Andrus. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general