Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: why administrator refuse to give permission on PLUSTRACE
> And just because I'm in the mood here's another one I give my students.
> Here's the setup.
>
> CREATE TABLE t (
> doc_id VARCHAR2(10),
> person_id NUMBER(7),
> doc_name VARCHAR2(45));
>
> CREATE INDEX ix_t_person_id
> ON t(person_id);
The main problem is : this table lacks a primary key
> That's was the set up. Here's the query identified as the problem.
> SELECT doc_name
> FROM t
> WHERE person_id = 221;
>
> Hint: You can get the cost to 1 with CPU = 0.
I get cost 2 with an index on (person_id, doc_name)
If more is really needed, I would dig out tom kyte's books and consider playing with the index, using another table organization, etc...
Calmly and very carefully. Received on Sat Nov 03 2007 - 12:58:48 CDT