You're right, I'm sorry. At the moment, we review the schema for tables and indexes and decided redesigned. I detected a loop in the join, because we only have a integer sequencial like PK and no composite keys in the tables. I think that is the mainly problem. Thanks! ----- Dame un poco de fe, eso me bastará. Rozvo Ware Solutions -- View this message in context: http://www.postgresql-archive.org/The-same-query-is-too-slow-in-some-time-of-execution-tp5951060p5951841.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general