I have a composite index in three columns in one of my tables. It works if I have three columns at the end of my query. When my search query has only two out of three, everything doesn't look so fast!
Do you know how to get around this?
Thanks,
There
PS table
APPL_PERF_STATS
has a composite index on (current_appl_id, event_name and generic_method_name) This took 2 minutes (using all the columns in the composite index):
SELECT * FROM APPL_PERF_STATS WHERE (GENERIC_METHOD_NAME! = 'NULL' AND CURRENT_APPL_ID! = 'NULL' AND EVENT_NAME! = 'NULL') AND ROWNUM <502 And current_appl_id = 'OMS' And event_name = 'OMS-CeaseProduct AND CallForwardFixedCOProduct 'AND appl_perf_interval_typ_id = 1440 And cover_period_start_ts> = to_date ('20 -07-2008 14:36', 'dd-mm-yyyy HH24: mi') AND cover_period_start_ts <= to_date ('19 -08-2009 14: 36 ',' dd-mm-yyyy HH24: mi ') ORDER BY CURRENT_APPL_ID, EVENT_NAME, GENERIC_METHOD_NAME, CREATE_TS
This took 12 minutes to run (using only 2 of the three in the composite index):
SELECT * FROM APPL_PERF_STATS (GENERIC_METHOD_NAME!= 'NULL' AND CURRENT_APPL_ID!= 'NULL' EVENT_NAME!= 'NULL') ROWNUM < 502 current_appl_id = 'OMS' event_name = 'OMS-CeaseProduct' AND appl_perf_interval_typ_id = 1440 cover_period_start_ts >= to_date ('20 -07-2008 14:36 ββ',' dd-mm-yyyy HH24: mi ') AND cover_period_start_ts <= to_date ('19 -08-2009 14:36 ββ',' dd-mm-yyyy HH24: mi ') ORDER BY CURRENT_APPL_ID, EVENT_NAME, GENERIC_METHOD_NAME, CREATE_TS
column_1
column_2
column_3
" , !" - ?
", " , 50 , 5 . "" , 500 , .
: , , / .
, cover_period_start_ts / appl_perf_interval_typ_id , . , , , , , .
PS. , , != 'NULL' where, , access_predicate filter_predicate
Source: https://habr.com/ru/post/1715663/More articles:ΠΠ°ΠΊ Ρ ΠΌΠΎΠ³Ρ ΠΏΠΎΠ»ΡΡΠΈΡΡ ΠΊΠΎΠ½ΠΊΡΠ΅ΡΠ½ΠΎΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ ΡΡΡΠΎΠΊΠΈ ΠΈΠ»ΠΈ ΡΡΠ΅ΠΉΠΊΠΈ ΠΈΠ· ΠΎΠ±ΡΠ΅ΠΊΡΠ° DataColumn Π±Π΅Π· ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ DataGrid? - .netWhat is a good, fast PRNG (not cryptographically secure) - randomMySQL is another UPDATE else INSERT statement - phpFast integer conversion in Python - performanceId type does not match id - but it does! - objective-cHow to reset netscape.security.PrivilegeManager.enablePrivilege? - javascriptJavascript substring - javascriptWith browsers that have full page scaling, can I use this function to set the zoom for iframes? - htmlIMetadataExchange ΠΡΠΈΠ±ΠΊΠ° ΠΊΠΎΠ½Π΅ΡΠ½ΠΎΠΉ ΡΠΎΡΠΊΠΈ MEX ΠΏΡΠΈ ΡΠ°Π·ΠΌΠ΅ΡΠ΅Π½ΠΈΠΈ ΡΠ»ΡΠΆΠ±Ρ WCF Π² ΠΊΠΎΠ½ΡΠΎΠ»ΡΠ½ΠΎΠΌ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ - .netIs app.config used only at compile time or is it required at runtime? - .netAll Articles