"Edwin Quijada" <listas_quijada@hotmail.com> writes:
> This select get 20 seconds to doing. My 2 first table has 500000 reords each
> one
The row counts mentioned in your explain output seem suspiciously small.
Have you ever ANALYZEd or VACUUMed these tables?
regards, tom lane