Re: How to optimize this query?

From: Maciej Piekielniak <piechcio(at)isb(dot)com(dot)pl>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to optimize this query?
Date: 2006-03-22 19:25:47
Message-ID: 121660763.20060322202547@isb.com.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)isb(dot)com(dot)pl

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Maciej Piekielniak 2006-03-22 20:01:34 Re: How to optimize this query?
Previous Message Jeffrey Melloy 2006-03-22 19:19:30 Re: How to optimize this query?