sort array optimisation in pl/perl

Поиск
Список
Период
Сортировка
От GIROIRE Nicolas (COFRAMI)
Тема sort array optimisation in pl/perl
Дата
Msg-id 1904E3EB39448246A7ECB76DF34A70B0036A4002@TOCOMEXC03
обсуждение исходный текст
Ответы Re: sort array optimisation in pl/perl  (Ragnar Hafstað <gnari@simnet.is>)
Список pgsql-general

Hi,

I create an array which is result of query on postgresql database and then I want to sort rows in a particular way (impossible by query on database).

My solution consists to put a rows (indice m+1) in a temporary other and then move all element before indice n to m in rows with indice n+1 to m+1 and last i put my temporary variable to indice n.

I want to know if somebody know a better solution.

I think of 2 solutions but i don't success to apply :
  - the first is to use list in which I could deplace references as a chained list
  - the second will be to deplace tab[n..m] to tab[n+1..m+1] in one instruction as ada language

Is one of this solution exists and is better than my first ? If yes, can you help me to implement ?

Best regards,

Nicolas

В списке pgsql-general по дате отправления:

Предыдущее
От: Dan Sugalski
Дата:
Сообщение: Re: plperl doesn't release memory
Следующее
От: Tom Lane
Дата:
Сообщение: Re: plperl doesn't release memory