Thread: Clustered tables and seqscan disabled

Clustered tables and seqscan disabled

From
Henrique Engelmann
Date:
Hi,
 
Sometime ago I worked in an implantation project that uses postgresql and I remember than the software house recommended us to use seqscan off...
I was not very sure, but I thought the best way should be set seqscan on and let postgresql choose the best access plan (index or seqscan). Even against the other team members I changed the configuration to seqscan on and the system didn´t worked anymore.
 
Studying better the reasons I verified that applications were expecting data in primary index order but with seqscan ON sometimes postgresql didn´t use an index and naturally data came without order.
 
I suggested changing the application and including  a order by clause... but
the software house didn´t make it because they said the system was originally designed for oracle and they did not need to use the ORDER BY clause with Oracle and even so the data were always retrieved in primary index order.
 
I´m thinking with myself ... what kind of problems will they have in the future?
 
I think this kind of configuration is very dependent of clustered tables... Am I right?
 
Best regards!
Engelmann.

__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/

Re: Clustered tables and seqscan disabled

From
Tom Lane
Date:
Henrique Engelmann <henriqueengelmann@yahoo.com.br> writes:
>   I suggested changing the application and including  a order by clause... but
> the software house didn�t make it because they said the system was originally designed for oracle and they did not
needto use the ORDER BY clause with Oracle and even so the data were always retrieved in primary index order. 

>   I�m thinking with myself ... what kind of problems will they have in the future?

If you aren't working with these people any more, be glad.  They are
obviously utterly incompetent.  The SQL standard is perfectly clear
about the matter: without ORDER BY, there is no guarantee about the
order in which rows are retrieved.  The fact that one specific
implementation might have chanced to produce the rows in desired order
(under all the conditions they had bothered to test, which I bet wasn't
a lot) does not make their code correct.

            regards, tom lane