Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Very fast select
On Fri, 02 Feb 2001 18:25:42 GMT, iustinami_at_my-deja.com wrote:
>Hi,
>
> I need very fast answers to <order by> selects
>on a table ( max 1-2 seconds ) that must contain
>a varchar field ( the <order by> field ). The
>table has about 300000 rows.
> I've tried indexing, primary key on varchar
>field, but still too slow. The server is Oracle
>8i on a K7, 256Mb running Win2000 ).
> I think I need something like the low-level
>order of rows in database to be exactly the
>varchar field order.
> If you have any ideea please help.
>
Apart from loading in the right sequence, stick an index on the varchar field and put an hint in your select:
SELECT /*+ INDEX_ASC(<table_name>,<index_name>) */
etc...
and take away the ORDER BY, you don't need it in this case.
Check on the manual for the exact syntax, I may have skipped a comma.
Cheers
Nuno Souto
nsouto_at_bigpond.net.au.nospam
http://www.users.bigpond.net.au/the_Den/index.html
Received on Sat Feb 03 2001 - 05:39:05 CST