473,480 Members | 3,021 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

help with query speed

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

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #1
1 1374
On Thu, 12 Feb 2004, Jason Tesser wrote:
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


Are tblroster.classlink and testclass.classid the same type and indexed?

Same for tblroster.lettergrade and tblqualitypoint.letter

Also is tblroster.transcriptlink indexed? Is the query using indexes?
Check it with

explain analyze <query>

and see what it says, look for big differences between expected and actual
rows, width, and loops.
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1831
by: Wouter | last post by:
Hi, I was wandering. Does the query speed also depend on the colums that you don't use in the query (so not in the where and not in the select part). I have a lange unused backup field in...
9
3396
by: majsen | last post by:
Hi, I have problem running this query. It will time out for me... My database are small just about 200 members. I have a site for swaping appartments (rental). my query should look for match in...
3
1373
by: Bruce D | last post by:
Here's the breakdown: MySQL 4.0.12 Table: Assignment (indexes are created on proper fields) 419,234 records Table: Finders (indexes are created on proper fields) 5,345,657 records My user wants...
2
1708
by: Sebastian | last post by:
The following query needs about 2 minutes to complete (finding dupes) on a table of about 10000 addresses. Does anyone have an idea on how to speed this up ? Thanks in advance !!! Sebastian
3
1229
by: Patric | last post by:
Hi I'm having some problem getting the following result. I have 2 tables Drivers -------- DriverID int (PK) DriverName varchar(50)
4
1627
by: trint | last post by:
Ok, This script is something I wrote for bringing up a report in reporting services and it is really slow...Is their any problems with it or is their better syntax to speed it up and still provide...
4
3377
by: Miks | last post by:
The database scheme consists of four relations: Product(maker, model, type) PC(code, model, speed, ram, hd, cd, price) Laptop(code, model, speed, ram, hd, screen, price) Printer(code, model,...
5
4735
by: - | last post by:
I have only 1m records in my database running on a laptop of speed 1.6GHz, memory 512MB ram, and Toshiba MK8032GAX hard disk. I use 'LIMIT x,10' for the query to utilise record paging. When the...
16
3562
by: Sam Durai | last post by:
Hello, I need to merge a small table (of rows less than 100,sometimes even 0 rows) to a big table (of rows around 4 billion). I used the PK of the big table as merge key but merge does a table scan...
3
1894
by: binita2908 | last post by:
Hi all , I am using MySql5.0 My database schema consists of four relations: Product(maker, model, type) PC(code, model, speed, ram, hd, cd, price) Laptop(code, model, speed, ram, hd,...
0
6920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6760
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3013
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3004
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.