From: | Joel Burton <jburton(at)scw(dot)org> |
---|---|
To: | Kevin Heflin <kheflin(at)shreve(dot)net> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Need help with query |
Date: | 2001-04-18 01:33:40 |
Message-ID: | Pine.LNX.4.21.0104172132480.10991-100000@olympus.scw.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Tue, 17 Apr 2001, Kevin Heflin wrote:
> Don't know if this would be the correct place to ask this. We have a
> postgresql server running version 6.5.3
> It hosts a 100 or so different databases, and performs just great. I do
> however have one query which takes about 20 seconds to complete. The
> database only has 200-300 records. Don't know much about SQL other than
> simple selects and inserts. I'm the one who created the query in
> question, and even today when I look at it, I'm not sure I understand
> it, but it gives us the results we want, it's just very slow.
>
> I'm sure someone with some SQL know-how could probably shorten this
> query down some. But it's way over my head.
>
> Basically I've got a database with these tables:
> client (list of clients)
> project (each project belongs to a client)
> subproject (each subproject belongs to a project)
> status (each project has a status)
> users (each project and subproject are assigned to a user)
> timelog (each timelog record indicates time worked on a particular
> subproject and who worked on it)
>
> A sample row would look like this:
>
>
> project_id|project_title|clientid|status|percentcomplete|duedate
> |usersid|client_id|name
> |users_id|users_name|status_id|status_name|hoursworked
> ----------+-------------+--------+------+---------------+----------+-------+
> ---------+-----------+--------+----------+---------+-----------+-----------
> 143|project 1 | 79| 3|
> 100|04-06-2001| 8| 79|Client Name| 8| Kevin|
> 3|status | 1
Kevin --
Looking quickly at your problem, I have one or two ideas, but need to play
for a few minutes.
Can you post a schema and a small amount of data?
--
Joel Burton <jburton(at)scw(dot)org>
Director of Information Systems, Support Center of Washington
From | Date | Subject | |
---|---|---|---|
Next Message | Roberto Mello | 2001-04-18 01:42:02 | Re: [SQL] Where are the 7.1 RPM's? |
Previous Message | clayton | 2001-04-18 01:12:40 | Re: [SQL] Where are the 7.1 RPM's? |