473,548 Members | 2,683 Online
Bytes | Software Development & Data Engineering Community
+ 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.trans criptlink
FROM
tblroster
FULL OUTER JOIN testclass ON (tblroster.clas slink = testclass.class id)
FULL OUTER JOIN tblqualitypoint ON (tblroster.lett ergrade =
tblqualitypoint .letter)
ORDER BY
tblroster.trans criptlink

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

Nov 22 '05 #1
1 1378
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.trans criptlink
FROM
tblroster
FULL OUTER JOIN testclass ON (tblroster.clas slink = testclass.class id)
FULL OUTER JOIN tblqualitypoint ON (tblroster.lett ergrade =
tblqualitypoint .letter)
ORDER BY
tblroster.trans criptlink


Are tblroster.class link and testclass.class id the same type and indexed?

Same for tblroster.lette rgrade and tblqualitypoint .letter

Also is tblroster.trans criptlink 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*******@postg resql.org

Nov 22 '05 #2

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

Similar topics

2
1839
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 every row. I only put the backup information into that field once. But never use it on my live database.
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 a triangle. Like this member A -> B->C A give his appartment to B. B gives his appartment to C and finally C gives his appartment to A Soo my...
3
1376
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 to be able to do a wild card search on lastname in the finders table. So, I wrote the following query. SELECT Finders.Lastname,...
2
1712
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
1237
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
1636
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 the same report results?: SELECT t1.MemberId, t1.PeriodID, t8.start_date, t6.amount_type_id, t6.amount_type, SUM(CASE WHEN t2.amountTypeId...
4
3381
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, color, type, price) The relation "Product" shows the maker, model number, and type (pc, laptop, or printer). It is assumed that model numbers are...
5
4742
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 value of x is nearer to 0, the query speed is fast. Presently, 'LIMIT 0,10', 'LIMIT 50000,10' and 'LIMIT 100000,10' takes about 0sec, 11secs and...
16
3578
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 so it runs for ever. I checked the table and PK statistics of the big table and it looks good. Please let me know if I need to check for...
3
1899
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, screen, price) Printer(code, model, color, type, price)
0
7438
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7707
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7951
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7466
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7803
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5362
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3475
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
751
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.