Posts

Showing posts with the label indexrange

Indexes and Functions - 01

The user said me that the table has a index in the date column that he used in his query SQL but is too slow. That is true, this table ( TB_EVENTS ) has an index in date type column ( EVNT_PK ).  SQL> SELECT TABLE_NAME , COLUMN_NAME , DATA_TYPE FROM DBA_TAB_COLUMNS WHERE TABLE_NAME = 'TB_EVENTS' AND COLUMN_NAME = 'EVENT_DATE' ; TABLE_NAME                     COLUMN_NAME                      DATA_TYPE ------------------------------ -------------------------------- ------------ TB_EVENTS                      EVENT_DATE                       DATE SQL> SELECT COL . INDEX_NAME ,    COL . COLUMN_NAME   FROM SYS . DBA_IND_COLUMNS COL   WHERE OWNER = 'PSP' AND INDEX_NAME = 'EVNT_PK' ; INDEX_NAME                     COLUMN_NAME ------------------------------ -------------------------------- EVNT_PK                        EVENT_DATE Ok, He use EVENT_DATE column in the WHERE but also use TO_CHAR function in