El vie, 16-04-2010 a las 14:04 -0500, Jaime Casanova escribió: > 2010/4/16 Manuel Fernando Aller <manuel.al...@gmail.com>: > > > > Qué olvidé considerar? > > > > imagino que hiciste un ANALYZE en las dos bases luego de crear los > indices, verdad?
Le hice analyze, si. > puedes mostrar ambos planes de ejecución? que versión de postgres es esta? plan 'partido': QUERY PLAN ---------------------------------------------------------------------------------------------------------------------- Limit (cost=196553.64..196553.65 rows=3 width=830) -> Sort (cost=196553.64..208783.60 rows=4891984 width=830) Sort Key: public.maestra.maestra_timestamp -> Result (cost=0.00..133325.66 rows=4891984 width=830) -> Append (cost=0.00..133325.66 rows=4891984 width=830) -> Seq Scan on maestra (cost=0.00..11.12 rows=30 width=830) Filter: (maestra_timestamp >= '2010-03-01 00:22:00'::timestamp without time zone) -> Seq Scan on maestra201003 maestra (cost=0.00..84760.52 rows=3109091 width=89) Filter: (maestra_timestamp >= '2010-03-01 00:22:00'::timestamp without time zone) -> Seq Scan on maestra201004 maestra (cost=0.00..48554.01 rows=1782863 width=89) Filter: (maestra_timestamp >= '2010-03-01 00:22:00'::timestamp without time zone) (11 filas) el plan de la original: QUERY PLAN ------------------------------------------------------------------------------------------------------------ Limit (cost=0.00..0.13 rows=3 width=88) -> Index Scan using ix_maestra_timestamp on maestra (cost=0.00..142343.22 rows=3314407 width=88) Index Cond: (maestra_timestamp >= '2010-03-01 00:22:00'::timestamp without time zone) (3 filas) ahora, mirando esto, pregunto, por qué no quiere usar los índices en el esquema particionado? la versión de postgres es la 8.3, instalada de rpm: [r...@battlecat ~]# rpm -qa |grep postg postgresql-libs-8.3.9-1PGDG.rhel5 postgresql-contrib-8.3.9-1PGDG.rhel5 postgresql-8.3.9-1PGDG.rhel5 postgresql-devel-8.3.9-1PGDG.rhel5 postgresql-server-8.3.9-1PGDG.rhel5 -- Manuel Fernando Aller <manuel.al...@gmail.com> -- TIP 1: para suscribirte y desuscribirte, visita http://archives.postgresql.org/pgsql-es-ayuda