I have a big table in oracle database (it's almost 400 million rows) and a program which connects to that table and executes a query.
I don't have any possibility to modify the program neither the database structure.
The problem is that the query execution takes long time. Sometimes 11 seconds, which in my case is really bad. But the query is always the same. It's something like:
SELECT COL1, COL2 FROM TABLE1 WHERE upper(COL3) = upper('abc')
and the result is ~5 rows.
These are the indexes in the table from COL3:
CREATE INDEX "DATABASE1"."PIPTABLE1_2" ON "DATABASE1"."PTABLE1" (UPPER("COL3"))
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "DATABASE1_INDX";
CREATE INDEX "DATABASE1"."PIPTABLE1_3" ON "DATABASE1"."PTABLE1" ("COL3")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "DATABASE1_INDX";
Is there any way to optimize it on database level?
(Oracle Database Version = 19c)
In the execution plan below I had to hide real names and values. (Of course now (Saturday) the query worked fast)