pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Maciej Piekielniak <piechcio@isb.com.pl>
To: pgsql-sql@postgresql.org
Subject: Re: How to optimize this query?
Date: Wed, 22 Mar 2006 20:25:47 +0100
Message-ID: <121660763.20060322202547@isb.com.pl> (raw )
In-Reply-To: <684362e10603221112m3ce21e96x@mail.gmail.com >
References: <827987076.20060322181715@isb.com.pl >
<684362e10603220958s2dac37cfp@mail.gmail.com >
<1731392587.20060322191801@isb.com.pl >
<684362e10603221027t354b079bh@mail.gmail.com >
<684362e10603221032t4b07f5edu@mail.gmail.com >
<672339640.20060322200740@isb.com.pl >
<684362e10603221112m3ce21e96x@mail.gmail.com >
Hello Markus,
Wednesday, March 22, 2006, 8:12:35 PM, you wrote:
MB> Well, send the table descriptions, please.
\d towar
max3 | smallint | default 0
max4 | smallint | default 0
typik | character varying(1) | default '_'::character varying
id_grupa_rabatowa | integer | not null default 0
id_jednostka_miary | integer | not null default 0
id_vat | integer | not null default 0
id_typ_towaru | integer | not null default 0
id_dostawcy | integer | not null default 0
grupa_produkcji | smallint |
dodatek | boolean | not null default false
policzalne | boolean | not null default true
simport | character varying(50) |
czy_procent | boolean | not null default false
subtyp | character varying(35) |
kontofk | character varying(40) |
typks | character varying(30) |
nazwarodzaju | character varying(50) |
nazwakatalogu | character varying(250) |
waluta | character varying(3) | not null default 'PLN'::character varying
bank | character varying(5) | not null default 'NBP'::character varying
procent_do_wyceny | smallint | not null default 0
waga | numeric(24,4) | not null default 0
cena_z | numeric(24,4) | not null default 0
ilosc_paczkowa | numeric(24,4) | not null default 0
ilosc_jed | numeric(24,4) | not null default 1
ilosc_nom | numeric(24,4) | not null default 1
odpad | numeric(24,4) | not null default 0
cena_jedn | numeric(24,4) | not null default 0
roboczojednostka | numeric(24,4) | not null default 0
Indexes:
"towar_pkey" PRIMARY KEY, btree (id_towar)
"towar_key1" btree (key1)
"towar_key2" btree (key2)
Foreign-key constraints:
"$1" FOREIGN KEY (id_grupa_rabatowa) REFERENCES grupa_rabatowa(id_grupa_rabatowa) ON UPDATE CASCADE ON DELETE SET NULL
"$2" FOREIGN KEY (id_jednostka_miary) REFERENCES jednostka_miary(id_jednostka_miary) ON UPDATE CASCADE ON DELETE SET NULL
"$3" FOREIGN KEY (id_vat) REFERENCES vat(id_vat) ON UPDATE CASCADE ON DELETE SET NULL
"$4" FOREIGN KEY (id_typ_towaru) REFERENCES typ_towaru(id_typ_towaru) ON UPDATE CASCADE ON DELETE SET NULL
"$5" FOREIGN KEY (id_dostawcy) REFERENCES dostawcy(id_dostawcy) ON UPDATE CASCADE ON DELETE SET NULL
Triggers:
towar_domyslne BEFORE INSERT ON towar FOR EACH ROW EXECUTE PROCEDURE domyslne_ustawienia()
zmiana_wagi AFTER UPDATE ON towar FOR EACH ROW EXECUTE PROCEDURE waga_przelicz()
--
Best regards,
Maciej mailto:piechcio@isb.com.pl
view thread (28+ messages) latest in thread
Message-ID: <121660763.20060322202547@isb.com.pl>
Permalink: ../121660763.20060322202547@isb.com.pl/
Also on: postgresql.org/message-id/121660763.20060322202547@isb.com.pl
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: piechcio@isb.com.pl
Subject: Re: How to optimize this query?
In-Reply-To: <121660763.20060322202547@isb.com.pl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox