| От | Beatrice Yueksel |
|---|---|
| Тема | Problem with timestamp |
| Дата | |
| Msg-id | 3DF71684.5080208@msys.ch обсуждение исходный текст |
| Список | pgsql-sql |
Hello, I try to check the time needed by a function. I would like to :. select current_timestamp,. execute 5000 times a function. select the current_timestamp and return theinterval. Problem : the interval is always '00:00', the two timestamps have always the same value. Could you help me ? have you any suggestions for testing sql functions speed? Thank you in advance, Béatrice create function test_function() returns interval as ' declare j integer; t1 timestamp; t2 timestamp; t3 interval; x integer; begin select into t1 now(); FOR j in 0..5000 loop select into x get_function_to_test(); end loop; select intot2 now(); t3 := t2 - t1; RAISE NOTICE '' from % to % = %'',t2,t1,t3; return t3; end; ' language 'plpgsql';
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера