gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] Praxis encounter location slow to populate


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] Praxis encounter location slow to populate
Date: Wed, 4 Jun 2014 12:25:20 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Jun 02, 2014 at 10:48:24PM +0000, Jim Busser wrote:

> Can some adjustment be made so that the query fetches only
> those rows which represent a praxis location within the
> virtual or distributed praxis?

It never did anything else. Phrasewheel SQL:

        SELECT
                pk_praxis_branch AS data,
                branch || ' (' || praxis || ')' AS field_label,
                branch || coalesce(' (' || l10n_unit_category || ')', '') || ' 
of ' || l10n_organization_category || ' "' || praxis || '"' AS list_label
        FROM
                dem.v_praxis_branches
        WHERE
                branch %(fragment_condition)s
                        OR
                praxis %(fragment_condition)s
                        OR
                l10n_unit_category %(fragment_condition)s
        ORDER BY
                list_label
        LIMIT 50

View definition:

        create view dem.v_praxis_branches as

        select
                d_pb.pk
                        as pk_praxis_branch,
                d_vou.organization
                        as praxis,
                d_vou.unit
                        as branch,
                d_vou.organization_category,
                d_vou.l10n_organization_category,
                d_vou.unit_category,
                d_vou.l10n_unit_category,
                d_vou.pk_org,
                d_pb.fk_org_unit
                        as pk_org_unit,
                d_vou.pk_category_org,
                d_vou.pk_category_unit,
                d_vou.pk_address,
                d_pb.xmin
                        as xmin_praxis_branch,
                d_vou.xmin_org_unit
        from
                dem.praxis_branch d_pb
                        left join dem.v_org_units d_vou on (d_pb.fk_org_unit = 
d_vou.pk_org_unit)
        ;

Anything else would be insane.

I'll check whether there are sufficient indices.

Karsten
-- 
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



reply via email to

[Prev in Thread] Current Thread [Next in Thread]