Обсуждение: Postgresql tuning..

Поиск
Список
Период
Сортировка

Postgresql tuning..

От
jerome
Дата:
what would be faster on SELECT and UPDATE query...
a table with a varchar as a primary key or an int primary keyed column..

TIA

Re: Postgresql tuning..

От
dima
Дата:
> what would be faster on SELECT and UPDATE query...
> a table with a varchar as a primary key or an int primary keyed column..
varchar primary keys are always slower



about ecpg

От
wlj
Дата:
hi!

my question is :
how to accomplish this function by ecpg

exec sql declare test_curcor cursor for select * form test;//test(id,name)
exec sql open test_curcor;
...
exec sql update test set id=1 where current of test_curcor;

the postgresql didn't support this function "... current of "

how can i do
thank you !!



Re: Postgresql tuning..

От
jerome
Дата:
would it make a difference if ill be using an 12 digit primary key compared
to a 12 chars primary keyed table....


difference in terms of speed/performance from a select and update queries...

TIA

On Thursday 29 August 2002 03:30, you wrote:
> > what would be faster on SELECT and UPDATE query...
> > a table with a varchar as a primary key or an int primary keyed column..
>
> varchar primary keys are always slower
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

Re: about ecpg

От
Michael Meskes
Дата:
On Thu, Aug 29, 2002 at 03:38:53PM +0800, wlj wrote:
> how to accomplish this function by ecpg
>
> exec sql declare test_curcor cursor for select * form test;//test(id,name)
> exec sql open test_curcor;
> ...
> exec sql update test set id=1 where current of test_curcor;
>
> the postgresql didn't support this function "... current of "

Is this a question concerning ecpg? Or do you want to know how to do
this in PostgreSQL? AFAIK we do not have a "current of" clause. Please
correct my if I'm wrong.

If we had we would need to declare a cursor "for update", but to the
best of my knowledge declare for update is not supported. Or in other
words, cursors are read-only.

Michael
--
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!