Re: prefetching key paths problem

Laurence Mills-Gahl <[email protected]> Mon, 8 Feb 2016 10:46:38 -0500
Newsgroups gmane.comp.web.webobjects.wonder-disc
Message-ID <[email protected]>
--===============3883332527066202484==
Content-Type: multipart/signed;
	boundary="Apple-Mail=_EC3EEEC6-08FC-46F9-A3AE-04BC9ACE1FA2";
	protocol="application/pgp-signature"; micalg=pgp-sha256


--Apple-Mail=_EC3EEEC6-08FC-46F9-A3AE-04BC9ACE1FA2
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_D9513629-FB00-40B0-BD49-9DC68FAB32EC"


--Apple-Mail=_D9513629-FB00-40B0-BD49-9DC68FAB32EC
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Thanks. I=E2=80=99ll try that.

I thought it might have been something with the derived column, but =
setting up the qualifier to use a range of plain NSTimestamp (date time) =
columns also showed the same join problem.




Larry Mills-Gahl
[email protected]






> On Feb 8, 2016, at 3:29 AM, Fabian Peters <[email protected]> =
wrote:
>=20
> Hi Larry,
>=20
> You could try using a read format instead of a derived column. I seem =
to remember that a problem like you're having made me move to those. You =
basically make it a normal attribute with a column name and put the SQL =
into the read format. You still don't need to create the column in the =
DB.
>=20
> Fabian
>=20
>> Am 08.02.2016 um 02:46 schrieb Laurence Mills-Gahl =
<[email protected]>:
>>=20
>> Hello,
>>=20
>> I am running into a problem with prefetching that appears to be =
related to a derived column.
>>=20
>> The model is Treatments with to-many Alerts (treatment.alerts)
>> Treatments has a derived column with the YEARWEEK which is used =
mostly for post fetch grouping. I also use it to fetch ranges of data =
(weeks)
>>=20
>> The problem is that when I set prefetchKeyPaths to =
NSArray(=E2=80=9Calerts), I get sql generated that puts the derived =
column in the alerts instead of the treatments.
>> Here is the SQL
>>=20
>> SELECT t0.e1, t0.e2, t0.e3, t0.threshold, t0.tripletDate,
>> RTRIM(t0.triplettype), t0.tripletKey FROM triplet t0,
>> encounter T1 WHERE ((t0.triplettype =3D ? OR t0.triplettype =3D ?)
>> AND (YEARWEEK(t0.startTime,1) =3D ? AND T1.centerKey =3D ?))
>> AND t0.e3 =3D T1.encounterKey
>> withBindings: 1:"a"(tripletType), 2:"v"(tripletType), =
3:201604(weekOfYear), 4:10296(centerkey)
>>=20
>>=20
>> YEARWEEK(t0.startTime,1) =3D ? is the problem. It should be =
YEARWEEK(t1, startTime,1)
>>=20
>> If the qualifier uses  startTime between two times, the same thing =
happens. The same thing happens if I use a fetch spec instead of =
ERXEOControlUtilities so Im thinking this is likely a MySQL Plugin =
issue. I did some poking around the alias creation in
>>=20
>> My next step is to turn to raw fetches with SQL, but I thought I=E2=80=99=
d ask if anybody else has seen this and has any advice.
>>=20
>>=20
>> Larry Mills-Gahl
>> [email protected]
>>=20
>>=20
>>=20
>>=20
>>=20
>>=20
>> =
--------------------------------------------------------------------------=
----
>> Site24x7 APM Insight: Get Deep Visibility into Application =
Performance
>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> Monitor end-to-end web transactions and take corrective actions now
>> Troubleshoot faster and improve end-user experience. Signup Now!
>> =
http://pubads.g.doubleclick.net/gampad/clk?id=3D272487151&iu=3D/4140______=
_________________________________________
>> Wonder-disc mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/wonder-disc
>=20


--Apple-Mail=_D9513629-FB00-40B0-BD49-9DC68FAB32EC
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" =
class=3D"">Thanks. I=E2=80=99ll try that.&nbsp;<div class=3D""><br =
class=3D""></div><div class=3D"">I thought it might have been something =
with the derived column, but setting up the qualifier to use a range of =
plain NSTimestamp (date time) columns also showed the same join =
problem.&nbsp;</div><div class=3D""><br class=3D""></div><div =
class=3D""><br class=3D""></div><div class=3D""><br class=3D""></div><div =
class=3D""><br class=3D""><div class=3D"">
<div style=3D"color: rgb(0, 0, 0); font-family: Helvetica;  font-style: =
normal; font-variant: normal; font-weight: normal; letter-spacing: =
normal; line-height: normal; orphans: 2; text-align: -webkit-auto; =
text-indent: 0px; text-transform: none; white-space: normal; widows: 2; =
word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px; word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " =
class=3D""><div style=3D"color: rgb(0, 0, 0); font-family: Helvetica;  =
font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: 2; text-align: =
-webkit-auto; text-indent: 0px; text-transform: none; white-space: =
normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px; word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " =
class=3D""><div class=3D"">Larry Mills-Gahl</div><div class=3D""><a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a></div><div class=3D""><br =
class=3D""></div><div class=3D""><br class=3D""></div></div><br =
class=3D"Apple-interchange-newline"></div><br =
class=3D"Apple-interchange-newline"><br =
class=3D"Apple-interchange-newline">
</div>
<br class=3D""><div><blockquote type=3D"cite" class=3D""><div =
class=3D"">On Feb 8, 2016, at 3:29 AM, Fabian Peters &lt;<a =
href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a>&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div class=3D""><div class=3D"">Hi =
Larry,<br class=3D""><br class=3D"">You could try using a read format =
instead of a derived column. I seem to remember that a problem like =
you're having made me move to those. You basically make it a normal =
attribute with a column name and put the SQL into the read format. You =
still don't need to create the column in the DB.<br class=3D""><br =
class=3D"">Fabian<br class=3D""><br class=3D""><blockquote type=3D"cite" =
class=3D"">Am 08.02.2016 um 02:46 schrieb Laurence Mills-Gahl &lt;<a =
href=3D"mailto:[email protected]" class=3D"">[email protected]</a>&gt;:<br=
 class=3D""><br class=3D"">Hello,<br class=3D""><br class=3D"">I am =
running into a problem with prefetching that appears to be related to a =
derived column.<br class=3D""><br class=3D"">The model is Treatments =
with to-many Alerts (treatment.alerts)<br class=3D"">Treatments has a =
derived column with the YEARWEEK which is used mostly for post fetch =
grouping. I also use it to fetch ranges of data (weeks)<br class=3D""><br =
class=3D"">The problem is that when I set prefetchKeyPaths to =
NSArray(=E2=80=9Calerts), I get sql generated that puts the derived =
column in the alerts instead of the treatments.<br class=3D"">Here is =
the SQL<br class=3D""><br class=3D"">SELECT t0.e1, t0.e2, t0.e3, =
t0.threshold, t0.tripletDate, <br class=3D"">RTRIM(t0.triplettype), =
t0.tripletKey FROM triplet t0, <br class=3D"">encounter T1 WHERE =
((t0.triplettype =3D ? OR t0.triplettype =3D ?) <br class=3D"">AND =
(YEARWEEK(t0.startTime,1) =3D ? AND T1.centerKey =3D ?)) <br =
class=3D"">AND t0.e3 =3D T1.encounterKey<br class=3D"">withBindings: =
1:"a"(tripletType), 2:"v"(tripletType), 3:201604(weekOfYear), =
4:10296(centerkey)<br class=3D""><br class=3D""><br =
class=3D"">YEARWEEK(t0.startTime,1) =3D ? is the problem. It should be =
YEARWEEK(t1, startTime,1)<br class=3D""><br class=3D"">If the qualifier =
uses &nbsp;startTime between two times, the same thing happens. The same =
thing happens if I use a fetch spec instead of ERXEOControlUtilities so =
Im thinking this is likely a MySQL Plugin issue. I did some poking =
around the alias creation in <br class=3D""><br class=3D"">My next step =
is to turn to raw fetches with SQL, but I thought I=E2=80=99d ask if =
anybody else has seen this and has any advice.<br class=3D""><br =
class=3D""><br class=3D"">Larry Mills-Gahl<br class=3D""><a =
href=3D"mailto:[email protected]" class=3D"">[email protected]</a><br =
class=3D""><br class=3D""><br class=3D""><br class=3D""><br class=3D""><br=
 class=3D""><br =
class=3D"">---------------------------------------------------------------=
---------------<br class=3D"">Site24x7 APM Insight: Get Deep Visibility =
into Application Performance<br class=3D"">APM + Mobile APM + RUM: =
Monitor 3 App instances at just $35/Month<br class=3D"">Monitor =
end-to-end web transactions and take corrective actions now<br =
class=3D"">Troubleshoot faster and improve end-user experience. Signup =
Now!<br =
class=3D"">http://pubads.g.doubleclick.net/gampad/clk?id=3D272487151&amp;i=
u=3D/4140_______________________________________________<br =
class=3D"">Wonder-disc mailing list<br =
class=3D"">[email protected]<br =
class=3D"">https://lists.sourceforge.net/lists/listinfo/wonder-disc<br =
class=3D""></blockquote><br class=3D""></div></div></blockquote></div><br =
class=3D""></div></body></html>=

--Apple-Mail=_D9513629-FB00-40B0-BD49-9DC68FAB32EC--

--Apple-Mail=_EC3EEEC6-08FC-46F9-A3AE-04BC9ACE1FA2
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQEcBAEBCAAGBQJWuLhfAAoJEH6+KDQxPmwvD48H/Rhkt9KDtzmIsiwX5C+814fM
Da/H8gLlzpzFG57RNBmu06SP45C9/S7g6xH4iJeujDeXjTDA2fHRsXEUpxd7pgvW
zjFftW6X3mYv+HqOpKwMGFi/rpt5Z8dT9c8rXMBnXJWl7Xotkgxx9fD5tUnVkB6o
jKEAvDWHzKoCh9Ae50E1F2ytdJbBVnWODI9+kCY9VWCQRLVT4XmiE6qOobIktMhZ
EAwdjVHR/Dy4MAsVrZ5uLtHmFVt3HVXgeVFC6jL2l2yIyPdsPNhL5qDOckJf0PDd
y8pm34jShJ1hu1ZHlkq+N3Y+tr3Uvnv6NjvWzPlLFmjSAyy0rQAX+uSzc1N4O5c=
=0TcI
-----END PGP SIGNATURE-----

--Apple-Mail=_EC3EEEC6-08FC-46F9-A3AE-04BC9ACE1FA2--


--===============3883332527066202484==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
--===============3883332527066202484==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Wonder-disc mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wonder-disc

--===============3883332527066202484==--