Forum OpenACS Development: Re: acs_object_id_seq creation speed

Collapse
Posted by Dirk Gomez on
Hmm, with above code snippet I had about 14 seconds with the view and about 7 seconds with the sequence - so for my setup the difference was quite big. I ran it against PG 7.3 - which version of PG did you use?
Collapse
Posted by Jeff Davis on
I did it in psql with output going to /dev/null.
time {db_nextval acs_object_id_seq} 1000
versus
time {db_nextval t_acs_object_id_seq} 1000
shows db_nextval is 6.6ms per id for the sequence versus 13.4ms for the view but that's because it tries the sequence first and then if it does not exist it tries the view (i.e. 2 trips to the db). It should probably just cache which ones it needs to use the view for (then it would be about the same speed).