Re: REVIEW: WIP: plpgsql - foreach in
От | Pavel Stehule |
---|---|
Тема | Re: REVIEW: WIP: plpgsql - foreach in |
Дата | |
Msg-id | AANLkTi=FU-XDD59vWo_HFJy2foSuCRTc+WbZ8okeyT+K@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: REVIEW: WIP: plpgsql - foreach in (Pavel Stehule <pavel.stehule@gmail.com>) |
Ответы |
Re: REVIEW: WIP: plpgsql - foreach in
Re: REVIEW: WIP: plpgsql - foreach in |
Список | pgsql-hackers |
Hello > > >> Other comments- I don't like using 'i' and 'j', you really should use >> better variable names, especially in large loops which contain other >> loops. I'd also suggest changing the outer loop to be equivilant to the >> number of iterations that will be done instead of the number of items >> and then to *not* update 'i' inside the inner-loop. That structure is >> really just confusing, imv (I certainly didn't entirely follow what was >> happening there the first time I read it). Isn't there a function you >> could use to pull out the array slice you need on each iteration through >> the array? I looked on code again. There are a few results: I'll change identifiers 'i' and 'j' with any, that you send. It's usual identifiers for nested loops and in this case they has really well known semantic - it's subscript of array. But others changes are more difficult we have to iterate over array's items because it allow seq. access to array's data. I need a global index for function "array_get_isnull". I can't to use a buildin functions like array_slize_size or array_get_slice, because there is high overhead of array_seek function. I redesigned the initial part of main cycle, but code is little bit longer :(, but I hope, it is more readable. Regards Pavel >> > > I don't know a better short index identifiers than I used. But I am > not against to change. > > I'll try to redesign main cycle. > > Regards > > Pavel Stehule > > > >> Thanks, >> >> Stephen >> >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.10 (GNU/Linux) >> >> iEYEARECAAYFAk086MEACgkQrzgMPqB3kigCzQCffx0iVSMjU2UbOgAOaY/MvtOp >> iKsAnA5tdhKxTssdXJ+Rda4qkhNVm26g >> =Yn5O >> -----END PGP SIGNATURE----- >> >> >
Вложения
В списке pgsql-hackers по дате отправления: