Vous n'êtes pas identifié(e).
- Contributions : Récentes | Sans réponse
Pages : 1
#1 Re : PSQL » Requete table partionnée » 24/08/2015 11:16:11
oui c est du Greenplum
bien vu
PS:
SELECT tableoid::regclass,count(*) from mkt.t_fac_member_mails_1_prt_3 group by tableoid::regclass
ca renvoit rien
#2 PSQL » Requete table partionnée » 21/08/2015 14:48:15
- postgresfan
- Réponses : 5
Bonjour,
j'ai une table partionnée avec 12 partitions:
Comment puis je obtenir le nombre de lignes de chaque partition?
Code:
CREATE TABLE mkt.t_fac_member_mails
(
ibroadlogid integer NOT NULL,
ideliveryid integer NOT NULL,
memberid integer NOT NULL,
siteid integer NOT NULL,
mail_id_quot integer NOT NULL,
istatus smallint NOT NULL,
histoloadid integer NOT NULL
)
WITH (
OIDS=FALSE
)
DISTRIBUTED BY (ibroadlogid, ideliveryid, memberid, mail_id_quot)
PARTITION BY RANGE(mail_id_quot)
(
START (20120301) END (20120331) INCLUSIVE WITH (appendonly=false),
START (20120401) END (20120430) INCLUSIVE WITH (appendonly=false),
START (20120501) END (20120531) INCLUSIVE WITH (appendonly=false),
START (20120601) END (20120630) INCLUSIVE WITH (appendonly=false),
START (20120701) END (20120731) INCLUSIVE WITH (appendonly=false),
START (20120801) END (20120831) INCLUSIVE WITH (appendonly=false),
START (20120901) END (20120930) INCLUSIVE WITH (appendonly=false),
START (20121001) END (20121031) INCLUSIVE WITH (appendonly=false),
START (20121101) END (20121130) INCLUSIVE WITH (appendonly=false),
START (20121201) END (20121231) INCLUSIVE WITH (appendonly=false),
DEFAULT PARTITION other WITH (appendonly=false)
)
;
ALTER TABLE mkt.t_fac_member_mails OWNER TO group_owner_prod;
GRANT ALL ON TABLE mkt.t_fac_member_mails TO group_owner_prod;
GRANT SELECT ON TABLE mkt.t_fac_member_mails TO g_pr_mkt_r;
et une partition:
CREATE TABLE mkt.t_fac_member_mails_1_prt_1
OF
(
CONSTRAINT t_fac_member_mails_1_prt_1_check CHECK (mail_id_quot >= 20120301 AND mail_id_quot <= 20120331)
)
INHERITS (mkt.t_fac_member_mails)
WITH (APPENDONLY=false,
OIDS=FALSE
)
DISTRIBUTED BY (ibroadlogid, ideliveryid, memberid, mail_id_quot);
ALTER PARTITION mkt.t_fac_member_mails_1_prt_1 OWNER TO group_owner_prod;
GRANT ALL ON PARTITION mkt.t_fac_member_mails_1_prt_1 TO group_owner_prod;
GRANT SELECT ON PARTITION mkt.t_fac_member_mails_1_prt_1 TO g_pr_mkt_r;
---------
merci
Pages : 1