Re: help with query speed - Mailing list pgsql-general

From Jason Tesser
Subject Re: help with query speed
Date
Msg-id 04875CB4331F0240A0AD66F970978651160A93@paul
Whole thread Raw
In response to help with query speed  ("Jason Tesser" <JTesser@nbbc.edu>)
Responses Re: help with query speed  (Richard Huxton <dev@archonet.com>)
Re: help with query speed  ("scott.marlowe" <scott.marlowe@ihs.com>)
List pgsql-general
Hi

> > I have the below query written.  I have removed a lot from the
select
> > Statement for simplicity sake.  The query takes way too long.
> > I am moving from an Access backend to a Postgres back with
> > Access in the front. The below query is taking like 14-20 seconds.
> > Is their a better way I can write the joins.  I would think that
> > Postgres should be fast than Access.  BTW I am writing these as
> > Pass through queries so it is not a problem with Access.  I
> > have Even ran the query directly against Postgres.
> >
> > SELECT
> >   tblroster.transcriptlink
> > FROM
> >   tblroster
> >   FULL OUTER JOIN testclass ON (tblroster.classlink =
> > testclass.classid)
> >   FULL OUTER JOIN tblqualitypoint ON (tblroster.lettergrade =
> > tblqualitypoint.letter)
> > ORDER BY
> >   tblroster.transcriptlink
>
> Is there an index on:
> tblroster.classlink
>
> Is there an index on:
> testclass.classid
>
> Is there an index on:
> tblroster.lettergrade
>
> Is there an index on:
> tblqualitypoint.letter
>
> Is there an index on:
> tblroster.transcriptlink

I created the indexes and it speed up a little.  Still a little slower
than
Access though.  Which I think should not be.  The testclass is a view
not
A query so I cannot make an index there.

What is the best way to index this stuff? Should I make one index
(b-tree)
And add all fkeys and pkey from that table?

> How many rows are in the tables?

pgsql-general by date:

Previous
From: Richard Welty
Date:
Subject: Re: I want to use postresql for this app, but...
Next
From: "scott.marlowe"
Date:
Subject: Re: help with query speed