Simple SELECT statement taking too long [message #65039] |
Mon, 05 April 2004 09:52 |
Cocoy
Messages: 4 Registered: April 2004
|
Junior Member |
|
|
hi oracle experts,
simple SQL statement:
select count(*) from xx_table_xx
returns 800k rows over 5 minutes!
index on 1 column.
what do you think is the problem??? this is really odd.
server spec: 8way 1GHZ 1GB memory.
thanks!
|
|
|
|
|
|
Re: Simple SELECT statement taking too long [message #65057 is a reply to message #65039] |
Fri, 09 April 2004 01:04 |
perumal
Messages: 3 Registered: March 2004
|
Junior Member |
|
|
Yes,
SELECT Count(ROWNUM) FROM table_name will work
faster tha SELECT COUNT(*) FROM table_name.
give us full Query.
Analyze the table.
Check for Optimazation RULE CBO/RBO.
Finally,if no way, you can go go for HINTS
this is the usual method for any query.
With out analyze the query, general info never solve your problem
|
|
|
|
Re: Simple SELECT statement taking too long [message #65108 is a reply to message #65045] |
Fri, 30 April 2004 09:51 |
D Mera
Messages: 1 Registered: April 2004
|
Junior Member |
|
|
I also found that a select count(*) from table fast scnas an ndex. I didn't think about it before, but isn't the number of records already info already stored? A simple count should return just a number. Is there any explanation?
TIA
|
|
|
Re: Simple SELECT statement taking too long [message #65112 is a reply to message #65039] |
Mon, 03 May 2004 18:53 |
Cocoy
Messages: 4 Registered: April 2004
|
Junior Member |
|
|
hi,
the query is now fast after i dropped/recreate the table. dropping just the index did not help. what do you think is the root cause why after drop and recreate (loaded with same amount of records) had improved the performance? is there such a term as TABLE CORRUPTION?
|
|
|
|