ok,thanks This time,adding condition this way WHERE FIEL1=:F1 AND FIEL2=:F2 AND (FIEL3=:F3 OR :F3 IS NULL) INTO .. DO .. is causing query to be much slower ... this WHERE FIEL1=:F1 AND FIEL2=:F2 AND (FIEL3=:F3 ) INTO .. DO ..takes 0.563s
82655 fetches, 1088 marks, 1584 reads, 50 writes. 197 inserts, 98 updates, 148 deletes, 19166 index, 66 seq.Delta memory: 11536 bytes.Total execution time: 0.563s but this takes 29.141sWHERE FIEL1=:F1 AND FIEL2=:F2 AND (FIEL3=:F3 OR :F3 IS NULL) INTO .. DO .. 1700290 fetches, 1065 marks, 3694 reads, 77 writes.198 inserts, 99 updates, 149 deletes, 29422 index, 68 seq.Delta memory: -71656 bytes.Total execution time: 29.141sScript execution finished. in both cases :F3 is NOT NULL thanks From: "Dmitry Yemanov dim...@users.sourceforge.net [firebird-support]" <firebird-support@yahoogroups.com> To: firebird-support@yahoogroups.com Sent: Wednesday, August 19, 2015 11:51 AM Subject: [firebird-support] Re: MAKE 'EXECUTE STATEMENT' USE INDEX 19.08.2015 10:26, 'Mr. John' wrote: > now index is used if I call > SELECT * FROM MYPROC(...) > but I use it in other procedures,no join on it just simply SELECT .. > FROM MYPROC(...) in this case I can see in the plan : > ...(MYPROC NATURAL)... That' OK. In complex plans, (MY_PROC NATURAL) just means a select from a procedure, it says nothing about actual plans inside MY_PROC. Dmitry #yiv8407870056 #yiv8407870056 -- #yiv8407870056ygrp-mkp {border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv8407870056 #yiv8407870056ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv8407870056 #yiv8407870056ygrp-mkp #yiv8407870056hd {color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}#yiv8407870056 #yiv8407870056ygrp-mkp #yiv8407870056ads {margin-bottom:10px;}#yiv8407870056 #yiv8407870056ygrp-mkp .yiv8407870056ad {padding:0 0;}#yiv8407870056 #yiv8407870056ygrp-mkp .yiv8407870056ad p {margin:0;}#yiv8407870056 #yiv8407870056ygrp-mkp .yiv8407870056ad a {color:#0000ff;text-decoration:none;}#yiv8407870056 #yiv8407870056ygrp-sponsor #yiv8407870056ygrp-lc {font-family:Arial;}#yiv8407870056 #yiv8407870056ygrp-sponsor #yiv8407870056ygrp-lc #yiv8407870056hd {margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}#yiv8407870056 #yiv8407870056ygrp-sponsor #yiv8407870056ygrp-lc .yiv8407870056ad {margin-bottom:10px;padding:0 0;}#yiv8407870056 #yiv8407870056actions {font-family:Verdana;font-size:11px;padding:10px 0;}#yiv8407870056 #yiv8407870056activity {background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv8407870056 #yiv8407870056activity span {font-weight:700;}#yiv8407870056 #yiv8407870056activity span:first-child {text-transform:uppercase;}#yiv8407870056 #yiv8407870056activity span a {color:#5085b6;text-decoration:none;}#yiv8407870056 #yiv8407870056activity span span {color:#ff7900;}#yiv8407870056 #yiv8407870056activity span .yiv8407870056underline {text-decoration:underline;}#yiv8407870056 .yiv8407870056attach {clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}#yiv8407870056 .yiv8407870056attach div a {text-decoration:none;}#yiv8407870056 .yiv8407870056attach img {border:none;padding-right:5px;}#yiv8407870056 .yiv8407870056attach label {display:block;margin-bottom:5px;}#yiv8407870056 .yiv8407870056attach label a {text-decoration:none;}#yiv8407870056 blockquote {margin:0 0 0 4px;}#yiv8407870056 .yiv8407870056bold {font-family:Arial;font-size:13px;font-weight:700;}#yiv8407870056 .yiv8407870056bold a {text-decoration:none;}#yiv8407870056 dd.yiv8407870056last p a {font-family:Verdana;font-weight:700;}#yiv8407870056 dd.yiv8407870056last p span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv8407870056 dd.yiv8407870056last p span.yiv8407870056yshortcuts {margin-right:0;}#yiv8407870056 div.yiv8407870056attach-table div div a {text-decoration:none;}#yiv8407870056 div.yiv8407870056attach-table {width:400px;}#yiv8407870056 div.yiv8407870056file-title a, #yiv8407870056 div.yiv8407870056file-title a:active, #yiv8407870056 div.yiv8407870056file-title a:hover, #yiv8407870056 div.yiv8407870056file-title a:visited {text-decoration:none;}#yiv8407870056 div.yiv8407870056photo-title a, #yiv8407870056 div.yiv8407870056photo-title a:active, #yiv8407870056 div.yiv8407870056photo-title a:hover, #yiv8407870056 div.yiv8407870056photo-title a:visited {text-decoration:none;}#yiv8407870056 div#yiv8407870056ygrp-mlmsg #yiv8407870056ygrp-msg p a span.yiv8407870056yshortcuts {font-family:Verdana;font-size:10px;font-weight:normal;}#yiv8407870056 .yiv8407870056green {color:#628c2a;}#yiv8407870056 .yiv8407870056MsoNormal {margin:0 0 0 0;}#yiv8407870056 o {font-size:0;}#yiv8407870056 #yiv8407870056photos div {float:left;width:72px;}#yiv8407870056 #yiv8407870056photos div div {border:1px solid #666666;height:62px;overflow:hidden;width:62px;}#yiv8407870056 #yiv8407870056photos div label {color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv8407870056 #yiv8407870056reco-category {font-size:77%;}#yiv8407870056 #yiv8407870056reco-desc {font-size:77%;}#yiv8407870056 .yiv8407870056replbq {margin:4px;}#yiv8407870056 #yiv8407870056ygrp-actbar div a:first-child {margin-right:2px;padding-right:5px;}#yiv8407870056 #yiv8407870056ygrp-mlmsg {font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv8407870056 #yiv8407870056ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv8407870056 #yiv8407870056ygrp-mlmsg select, #yiv8407870056 input, #yiv8407870056 textarea {font:99% Arial, Helvetica, clean, sans-serif;}#yiv8407870056 #yiv8407870056ygrp-mlmsg pre, #yiv8407870056 code {font:115% monospace;}#yiv8407870056 #yiv8407870056ygrp-mlmsg * {line-height:1.22em;}#yiv8407870056 #yiv8407870056ygrp-mlmsg #yiv8407870056logo {padding-bottom:10px;}#yiv8407870056 #yiv8407870056ygrp-msg p a {font-family:Verdana;}#yiv8407870056 #yiv8407870056ygrp-msg p#yiv8407870056attach-count span {color:#1E66AE;font-weight:700;}#yiv8407870056 #yiv8407870056ygrp-reco #yiv8407870056reco-head {color:#ff7900;font-weight:700;}#yiv8407870056 #yiv8407870056ygrp-reco {margin-bottom:20px;padding:0px;}#yiv8407870056 #yiv8407870056ygrp-sponsor #yiv8407870056ov li a {font-size:130%;text-decoration:none;}#yiv8407870056 #yiv8407870056ygrp-sponsor #yiv8407870056ov li {font-size:77%;list-style-type:square;padding:6px 0;}#yiv8407870056 #yiv8407870056ygrp-sponsor #yiv8407870056ov ul {margin:0;padding:0 0 0 8px;}#yiv8407870056 #yiv8407870056ygrp-text {font-family:Georgia;}#yiv8407870056 #yiv8407870056ygrp-text p {margin:0 0 1em 0;}#yiv8407870056 #yiv8407870056ygrp-text tt {font-size:120%;}#yiv8407870056 #yiv8407870056ygrp-vital ul li:last-child {border-right:none !important;}#yiv8407870056