From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: pginfo <pginfo@t1.unisoftbg.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: bad join performance
Date: Mon, 18 Aug 2003 10:45:25 -0700 (PDT)
Message-ID: <20030818104119.C30675-100000@megazone.bigpanda.com> (raw)
In-Reply-To: <3F40E9A9.12AE5D55@t1.unisoftbg.com>
On Mon, 18 Aug 2003, pginfo wrote:
> Hi ,
> I am using pg 7.3.3 on RH 7.3,
> dual Athlon
> 1 GB RAM.
>
> I have 2 tables a_acc and a_vid_doc (all PK are int).
>
> sizes:
>
> select count(IDS) from a_acc;
> count
> ---------
> 1006772
>
> select count(IDS) from a_vid_doc;
> count
> -------
> 25
>
> I have problem with the join ot this tables.
> I tryed this examples:
>
> explain analyze select G.IDS from A_ACC G join A_VID_DOC VD
> ON(G.IDS_VID_DOC=VD.IDS) WHERE G.IDS = 1338673 ;
In general the best index on A_ACC for this kind of query might
be on on A_ACC(IDS, IDS_VID_DOC). That should allow you to search
by IDS value but still get a sorted order of IDS_VID_DOC to help
the join.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: sszabo@megazone.bigpanda.com, pginfo@t1.unisoftbg.com
Subject: Re: bad join performance
In-Reply-To: <20030818104119.C30675-100000@megazone.bigpanda.com>
References: <3F40E9A9.12AE5D55@t1.unisoftbg.com> <20030818104119.C30675-100000@megazone.bigpanda.com>
* 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