not FIELD3 COULD BE NULL, VARIABLE :F3 AND THAT MEANS NO FILTER ON FIELD3
thanks
From: "[email protected] [firebird-support]"
<[email protected]>
To: [email protected]
Sent: Wednesday, August 19, 2015 8:00 PM
Subject: Re: [firebird-support] Re: MAKE 'EXECUTE STATEMENT' USE INDEX
Hi, i do not know what should happen in your case when FIEL3 is null?But
you can try WHERE FIEL1=:F1 AND FIEL2=:F2 AND (FIEL3=COALESCE(:F3, FIEL3) )
INTO .. DO .. regards,Karol Bieniaszewski From:
mailto:[email protected] Sent: Wednesday, August 19, 2015 1:29
PMTo: [email protected] Subject: Re: [firebird-support] Re: MAKE
'EXECUTE STATEMENT' USE INDEX 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
& nbsp; ) 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&nbs p;29.141sWHERE FIEL1=:F1 AND FIEL2=:F2 AND (FIEL3=:F3 OR
:F3 IS NULL) INTO .. DO ..
1700290 fetches, 1065 marks, 3694 reads, 77 w rites.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 [email protected] [firebird-support]"
<[email protected]>
To: [email protected]
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
#yiv3761988397 #yiv3761988397 -- #yiv3761988397ygrp-mkp {border:1px solid
#d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv3761988397
#yiv3761988397ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv3761988397
#yiv3761988397ygrp-mkp #yiv3761988397hd
{color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px
0;}#yiv3761988397 #yiv3761988397ygrp-mkp #yiv3761988397ads
{margin-bottom:10px;}#yiv3761988397 #yiv3761988397ygrp-mkp .yiv3761988397ad
{padding:0 0;}#yiv3761988397 #yiv3761988397ygrp-mkp .yiv3761988397ad p
{margin:0;}#yiv3761988397 #yiv3761988397ygrp-mkp .yiv3761988397ad a
{color:#0000ff;text-decoration:none;}#yiv3761988397 #yiv3761988397ygrp-sponsor
#yiv3761988397ygrp-lc {font-family:Arial;}#yiv3761988397
#yiv3761988397ygrp-sponsor #yiv3761988397ygrp-lc #yiv3761988397hd {margin:10px
0px;font-weight:700;font-size:78%;line-height:122%;}#yiv3761988397
#yiv3761988397ygrp-sponsor #yiv3761988397ygrp-lc .yiv3761988397ad
{margin-bottom:10px;padding:0 0;}#yiv3761988397 #yiv3761988397actions
{font-family:Verdana;font-size:11px;padding:10px 0;}#yiv3761988397
#yiv3761988397activity
{background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv3761988397
#yiv3761988397activity span {font-weight:700;}#yiv3761988397
#yiv3761988397activity span:first-child
{text-transform:uppercase;}#yiv3761988397 #yiv3761988397activity span a
{color:#5085b6;text-decoration:none;}#yiv3761988397 #yiv3761988397activity span
span {color:#ff7900;}#yiv3761988397 #yiv3761988397activity span
.yiv3761988397underline {text-decoration:underline;}#yiv3761988397
.yiv3761988397attach
{clear:both;display:table;font-family:Arial;font-size:12px;padding:10px
0;width:400px;}#yiv3761988397 .yiv3761988397attach div a
{text-decoration:none;}#yiv3761988397 .yiv3761988397attach img
{border:none;padding-right:5px;}#yiv3761988397 .yiv3761988397attach label
{display:block;margin-bottom:5px;}#yiv3761988397 .yiv3761988397attach label a
{text-decoration:none;}#yiv3761988397 blockquote {margin:0 0 0
4px;}#yiv3761988397 .yiv3761988397bold
{font-family:Arial;font-size:13px;font-weight:700;}#yiv3761988397
.yiv3761988397bold a {text-decoration:none;}#yiv3761988397 dd.yiv3761988397last
p a {font-family:Verdana;font-weight:700;}#yiv3761988397 dd.yiv3761988397last p
span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv3761988397
dd.yiv3761988397last p span.yiv3761988397yshortcuts
{margin-right:0;}#yiv3761988397 div.yiv3761988397attach-table div div a
{text-decoration:none;}#yiv3761988397 div.yiv3761988397attach-table
{width:400px;}#yiv3761988397 div.yiv3761988397file-title a, #yiv3761988397
div.yiv3761988397file-title a:active, #yiv3761988397
div.yiv3761988397file-title a:hover, #yiv3761988397 div.yiv3761988397file-title
a:visited {text-decoration:none;}#yiv3761988397 div.yiv3761988397photo-title a,
#yiv3761988397 div.yiv3761988397photo-title a:active, #yiv3761988397
div.yiv3761988397photo-title a:hover, #yiv3761988397
div.yiv3761988397photo-title a:visited {text-decoration:none;}#yiv3761988397
div#yiv3761988397ygrp-mlmsg #yiv3761988397ygrp-msg p a
span.yiv3761988397yshortcuts
{font-family:Verdana;font-size:10px;font-weight:normal;}#yiv3761988397
.yiv3761988397green {color:#628c2a;}#yiv3761988397 .yiv3761988397MsoNormal
{margin:0 0 0 0;}#yiv3761988397 o {font-size:0;}#yiv3761988397
#yiv3761988397photos div {float:left;width:72px;}#yiv3761988397
#yiv3761988397photos div div {border:1px solid
#666666;height:62px;overflow:hidden;width:62px;}#yiv3761988397
#yiv3761988397photos div label
{color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv3761988397
#yiv3761988397reco-category {font-size:77%;}#yiv3761988397
#yiv3761988397reco-desc {font-size:77%;}#yiv3761988397 .yiv3761988397replbq
{margin:4px;}#yiv3761988397 #yiv3761988397ygrp-actbar div a:first-child
{margin-right:2px;padding-right:5px;}#yiv3761988397 #yiv3761988397ygrp-mlmsg
{font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv3761988397
#yiv3761988397ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv3761988397
#yiv3761988397ygrp-mlmsg select, #yiv3761988397 input, #yiv3761988397 textarea
{font:99% Arial, Helvetica, clean, sans-serif;}#yiv3761988397
#yiv3761988397ygrp-mlmsg pre, #yiv3761988397 code {font:115%
monospace;}#yiv3761988397 #yiv3761988397ygrp-mlmsg *
{line-height:1.22em;}#yiv3761988397 #yiv3761988397ygrp-mlmsg #yiv3761988397logo
{padding-bottom:10px;}#yiv3761988397 #yiv3761988397ygrp-msg p a
{font-family:Verdana;}#yiv3761988397 #yiv3761988397ygrp-msg
p#yiv3761988397attach-count span {color:#1E66AE;font-weight:700;}#yiv3761988397
#yiv3761988397ygrp-reco #yiv3761988397reco-head
{color:#ff7900;font-weight:700;}#yiv3761988397 #yiv3761988397ygrp-reco
{margin-bottom:20px;padding:0px;}#yiv3761988397 #yiv3761988397ygrp-sponsor
#yiv3761988397ov li a {font-size:130%;text-decoration:none;}#yiv3761988397
#yiv3761988397ygrp-sponsor #yiv3761988397ov li
{font-size:77%;list-style-type:square;padding:6px 0;}#yiv3761988397
#yiv3761988397ygrp-sponsor #yiv3761988397ov ul {margin:0;padding:0 0 0
8px;}#yiv3761988397 #yiv3761988397ygrp-text
{font-family:Georgia;}#yiv3761988397 #yiv3761988397ygrp-text p {margin:0 0 1em
0;}#yiv3761988397 #yiv3761988397ygrp-text tt {font-size:120%;}#yiv3761988397
#yiv3761988397ygrp-vital ul li:last-child {border-right:none
!important;}#yiv3761988397