Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: query "select * from table_name where rownum = 1" very slow

Re: query "select * from table_name where rownum = 1" very slow

From: chao_ping <zhuchao_at_gmail.com>
Date: 13 Jul 2005 02:17:02 -0700
Message-ID: <1121246222.263851.147630@z14g2000cwz.googlegroups.com>


there are two possible reasons:
1. Your table is heavily fragmented , it was deleted by a batch job, and the first part of the table is all empty, doing full table scan will read from beginning to end and it took pretty long before it finanly find one row.

2. You are seeing some bug, and oracle is doing: select * from table_name, full scan the table, get all the result, and then return 1 row to you.

 What is your oracle version and os?
I ever hit 8174 with cursor_sharing=force, and it did do that. Received on Wed Jul 13 2005 - 04:17:02 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US