Re: reasons for modperl declines? ... pagination
Mithun Bhattacharya <[email protected]> Sat, 10 Aug 2024 01:11:03 -0500
| Newsgroups | gmane.comp.apache.mod-perl |
|---|---|
| Message-ID | <CAHTPV9Lmixd5n8o4KjjzU6sAifmDc_Lxrpeb0gHGzoRX2p2WKg@mail.gmail.com> |
--0000000000008a1387061f4e205b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable True - it will not return enough results if it is a sparse matrix. I might be biased because in my work it is ok to give less results if it is significantly faster. If exact numbers are required and the count is significantly higher then I would suggest keeping the select on primary keys but switch from a IN clause to a temporary table and do a join. On Sat, Aug 10, 2024, 12:54=E2=80=AFAM Guido Brugnara <[email protected]> wrote= : > Il 09/08/24 20:28, Mithun Bhattacharya ha scritto: > > First one is expensive and s cond is inefficient. Instead get the max and > min and split the numbers into appropriate batch. So if it is 345 to 2563= 6 > then 345 - 1345, 1346-2345 and so on and so forth. Why is the second quer= ry > inefficient because the IN clause is much slower than doing a between on > the primary key > > > Your method works only if the recordset contains adjacent primary keys. > > This condition happens only if you paginate a table without filters and > sorting. > > bye > gdo > > --0000000000008a1387061f4e205b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto"><p dir=3D"ltr">True - it will not return enough results i= f it is a sparse matrix. I might be biased because in my work it is ok to g= ive less results if it is significantly faster.</p> <p dir=3D"ltr">If exact numbers are required and the count is significantly= higher then I would suggest keeping the select on primary keys but switch = from a IN clause to a temporary table and do a join.</p></div><br><div clas= s=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Aug 10, 202= 4, 12:54=E2=80=AFAM Guido Brugnara <<a href=3D"mailto:[email protected]">gdo= @leader.it</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style= =3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding= -left:1ex"><u></u> =20 =20 =20 <div> <div>Il 09/08/24 20:28, Mithun Bhattacharya ha scritto:<br> </div> <blockquote type=3D"cite">First one is expensive and s cond is inefficient. Instead get the max and min and split the numbers into appropriate batch. So if it is 345 to 25636 then 345 - 1345, 1346-2345 and so on and so forth. Why is the second querry inefficient because the IN clause is much slower than doing a between on the primary key</blockquote> <p><br> </p> <p><span>Your method works only if the recordset contains adjacent primary keys.<br> </span><span><br> </span></p> <p><span>This condition happens only if you paginate a table without filters and sorting.<br> <br> bye<br> gdo<br> </span></p> <p></p> </div> </blockquote></div> --0000000000008a1387061f4e205b--