Two questions about join performance

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

Sorry for being so reiterative :)

The planifier isn't perfect for many queries...
Is there any way (without touch C code) to tell explicitly the plan of a query
to Postgres?

How can I manage the problem of select a few rows with a boolean atribute
when they are 5 rows in a table of 100000 rows?
I't must to be an index, but
the optimizer asumes that a Seq Scan is more cheap... yes, yes... I know :
if I ask for the 100000 then Seq Scan is the solution, but the interesting
query is the other : to extract the 5 rows with flag='Y' from whitin the
100000 rows with the flag='N'.

I'm in a big trouble because of all this.

TIA again.

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

#2Rudy Gireyev
rgireyev@cnmnetwork.com
In reply to: Roberto Moreda (#1)
Re: [GENERAL] Two questions about join performance

Well maybe now is a good time to take a look at your
design and see why you have to do this.
There just happens to be a number of great DBAs on
this list as well. :-)

Rudy

On 6 Aug 99, at 2:14, Roberto Moreda wrote:

Show quoted text

Sorry for being so reiterative :)

The planifier isn't perfect for many queries...
Is there any way (without touch C code) to tell explicitly the plan of a
query to Postgres?

How can I manage the problem of select a few rows with a boolean atribute
when they are 5 rows in a table of 100000 rows? I't must to be an index,
but the optimizer asumes that a Seq Scan is more cheap... yes, yes... I
know : if I ask for the 100000 then Seq Scan is the solution, but the
interesting query is the other : to extract the 5 rows with flag='Y' from
whitin the 100000 rows with the flag='N'.

I'm in a big trouble because of all this.

TIA again.

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