Slow joins

Started by Roberto Moredaover 26 years ago2 messagesgeneral
Jump to latest
#1Roberto Moreda
moreda@sanluis.net

I have a speed problem with a query that involves 3 tables.
I focused the problem in a scan in a big table (70000 rows) using a indexed
field. The field is a "flag" field which values only can be 'Y' or 'N'.
In the query I look for the values 'N' (average value = 10 rows over the
70000). Postgres does a Seq Scan.

How can I speed up that scan? How can I force the use of the index?

Where can I found general recomendations to speed up queries?

TIA

Roberto

--
Roberto Moreda
Resp. Dpto. Inform�tica Handem/San Luis
Tlf +34 981 779000
Fax +34 981 779022
Pol. Piadela Sur, Autov�a A6 Sal.567
15300 Betanzos (A Coru�a) - Espa�a

#2Dustin Sallings
dustin@spy.net
In reply to: Roberto Moreda (#1)
Re: [GENERAL] Slow joins

On Thu, 5 Aug 1999, Roberto Moreda wrote:

Have you vacuumed? Can you post your actual explain?

BTW, I would strongly encourage you to use boolean for this. I've
seen tables that used CHAR for such things and code that had to check for
one of the following values:

yYtT1 or nNfF0

Boolean can't have this problem.

# I have a speed problem with a query that involves 3 tables.
# I focused the problem in a scan in a big table (70000 rows) using a indexed
# field. The field is a "flag" field which values only can be 'Y' or 'N'.
# In the query I look for the values 'N' (average value = 10 rows over the
# 70000). Postgres does a Seq Scan.
#
# How can I speed up that scan? How can I force the use of the index?
#
# Where can I found general recomendations to speed up queries?
#
# TIA
#
# Roberto
#
# --
# Roberto Moreda
# Resp. Dpto. Inform���tica Handem/San Luis
# Tlf +34 981 779000
# Fax +34 981 779022
# Pol. Piadela Sur, Autov���a A6 Sal.567
# 15300 Betanzos (A Coru���a) - Espa���a
#
#

--
SA, beyond.com My girlfriend asked me which one I like better.
pub 1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin@spy.net>
| Key fingerprint = 87 02 57 08 02 D0 DA D6 C8 0F 3E 65 51 98 D8 BE
L_______________________ I hope the answer won't upset her. ____________