| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to escape hints in PL/SQL and use results of a sort to limit comparisons
Thank you, Andy - I was working pretty hard yesterday trying to get
this 3 page SQL script translated to PL/SQL so I could use frequency
information about rows that have duplicate values in the location
field to limit the the range of rows that have to be checked by Oracle.
(Shown clumsily here using rowid but using a sequence lower down. I
sort the table before creating the sequence - am at home so cannot type
that little gem that was devised yesterday)
I plan to check the sequence seq of each row (permanently stored in a field) by:
t1.seq < t2.seq +n and t1.seq > t2.seq -n where n = frequency -1)
So if I have a node (location) that occurs 10 times in the table and all other nodes have an equal or lesser frequency , Oracle will only need to consider 9 other rows relative to the current row's sequence.
I will remember to look not only at the last statement but also at the next line!!
It wonderful to feel one has friends rather than getting comments about DB don't sort - they can use the result of a sort as described above...
Sidey (it rhymes with Heidi)
Andy Hassall wrote:
![]() |
![]() |