pg/tcl performance related

Поиск
Список
Период
Сортировка
От wolfgang@alle-noten.de
Тема pg/tcl performance related
Дата
Msg-id wolfgang-1180309095226.A0218096@noten19.local
обсуждение исходный текст
Ответы Re: pg/tcl performance related
Список pgsql-general

Hi,

suppose I want to create a tcl function that basically walks through a long list and compares its
argument against all entries
In plain tcl I would probably write

set data {
  # .... lots of stuff here
}
proc check val {
  global data
  foreach d $data {
    # .... this does the work
  }
}

Now, for pl/tcl, I could use either

create function check(text) returns text as $$
set data {
  # the data value
}
foreach d $data {
   # the work
}
$$ language pltcl;
or
create function check(text) returns text as $$
if ![info exists GD(data)] {
   set GD(data) {
    # the data value
  }
}
foreach d $GD(data) {
  # the work
}
$$ language pltcl; 

Does this make any difference - i.e. how often will parsing the data happen?

Best regards
Wolfgang Hamann



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

Предыдущее
От: Bjørn T Johansen
Дата:
Сообщение: Re: Authentication?
Следующее
От: Aldrin Martoq Ahumada
Дата:
Сообщение: Postgresql upgrade to 9.5.12/10.3 changes pg_dump format for cloningschemas