![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
After a pg_dump/pg_restore (using the tar format) queries that were using the indices don't use them anymore until the indices are dropped and recreated. After that the indices are used the correct way. |
#3
| |||
| |||
|
|
On Thu, 2004-10-14 at 06:54 -0400, Tom Lane wrote: I do not believe that you remembered to ANALYZE after restore. unfortunately for your belief, i remembered. ![]() also, this problem can be replicated at will. i can send a dump that exposes the problem if necessary but i'll need some time to purge customers data and create a dump a can freely send. |
#4
| |||
| |||
|
|
"PostgreSQL Bugs List" <pgsql-bugs (AT) postgresql (DOT) org> writes: After a pg_dump/pg_restore (using the tar format) queries that were usi= ng=20 the indices don't use them anymore until the indices are dropped and=20 recreated. After that the indices are used the correct way.=20 =20 I do not believe that you remembered to ANALYZE after restore. |

#5
| |||
| |||
|
|
ok. attached to this mail is a dump in tar format. this is the EXPLAIN ANALYZE of a query *before* the dump: EXPLAIN ANALYZE SELECT * FROM BOL_USC WHERE UPPER(RPAD("RAGIONE",80)||TO_CHAR("IDBOL_USC",'S00 00000000')) >= ' +0000000000' ORDER BY UPPER(RPAD("RAGIONE",80)||TO_CHAR("IDBOL_USC",'S00 00000000')) ASC LIMIT 2; Limit (cost=0.00..5.99 rows=2 width=1279) (actual time=154.868..170.753 rows=2 loops=1) -> Index Scan using "BOL_USCI3" on bol_usc (cost=0.00..20539.92 rows=6859 width=1279) (actual time=154.859..170.734 rows=2 loops=1) Index Cond: (upper((rpad(("RAGIONE")::text, 80, ' '::text) || to_char("IDBOL_USC", 'S0000000000'::text))) >= ' +0000000000'::text) Total runtime: 171.106 ms [ but after dump and restore this turns into a sequential scan ] |
![]() |
| Thread Tools | |
| Display Modes | |
| |