pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
faster or ..... ????
3+ messages / 3 participants
[nested] [flat]

* faster or ..... ????
@ 2005-10-06 04:54 dedy <slackman@unika.ac.id>
  2005-10-06 13:25 ` Re: faster or ..... ???? Dario <dario_d_s@unitech.com.ar>
  2005-10-07 04:48 ` Re: faster or ..... ???? Tim Allen <tim@proximity.com.au>
  0 siblings, 2 replies; 3+ messages in thread

From: dedy @ 2005-10-06 04:54 UTC (permalink / raw)
  To: pgsql-admin

Hii all,
I eould like to asking about creating table in postgres
here is the
1> can postgres do such things like this one?
  # create table address as object(address varchar(100), post(6));
  # create table id (id integer not null primary key,
                     name char(100),address); 

now i will
compare with this one >>
# create table id (id integer not null primary key, name char(100));
# create table address (id integer not null references id,
                       address varchar(100), post(6)); 

which is most faster??? 

Thank you very much for all your kind to answer my question
and my english is so bad isn't? 

Dedy Styawan
Semarang



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: faster or ..... ????
  2005-10-06 04:54 faster or ..... ???? dedy <slackman@unika.ac.id>
@ 2005-10-06 13:25 ` Dario <dario_d_s@unitech.com.ar>
  1 sibling, 0 replies; 3+ messages in thread

From: Dario @ 2005-10-06 13:25 UTC (permalink / raw)
  To: dedy <slackman@unika.ac.id>; pgsql-admin

1) mmm... create table x as object doesn't seem to be a valid statement.... You can create types, or use arrays. But I think you don't need (neither want) that... 
2) (which one is faster?) I'm not sure what are your plans for this tables. How many rows are you trying to insert into address for each ID? do you need to search for address? As a programmer, I definitly wouldn't do something like the first option (using arrays) except that I'm positibly sure that I will ALWAYS (no exception) retreat all address everytime I need an "id" record and they are not too many for each id. And I (or my bosses) will never want to look people for address. As a dba, I would kill that programmer.
3) My english s*cks too.

-----Mensaje original-----
De: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]En nombre de dedy
Enviado el: jueves, 06 de octubre de 2005 1:55
Para: pgsql-admin@postgresql.org
Asunto: [ADMIN] faster or ..... ????


Hii all,
I eould like to asking about creating table in postgres
here is the
1> can postgres do such things like this one?
  # create table address as object(address varchar(100), post(6));
  # create table id (id integer not null primary key,
                     name char(100),address); 

now i will
compare with this one >>
# create table id (id integer not null primary key, name char(100));
# create table address (id integer not null references id,
                       address varchar(100), post(6)); 

which is most faster??? 

Thank you very much for all your kind to answer my question
and my english is so bad isn't? 

Dedy Styawan
Semarang

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: faster or ..... ????
  2005-10-06 04:54 faster or ..... ???? dedy <slackman@unika.ac.id>
@ 2005-10-07 04:48 ` Tim Allen <tim@proximity.com.au>
  1 sibling, 0 replies; 3+ messages in thread

From: Tim Allen @ 2005-10-07 04:48 UTC (permalink / raw)
  To: dedy <slackman@unika.ac.id>; +Cc: pgsql-admin

dedy wrote:
> Hii all,
> I eould like to asking about creating table in postgres

Koq belum ada yg jawab - pada kurang ngerti, kali, Mas :).

> here is the
> 1> can postgres do such things like this one?
>  # create table address as object(address varchar(100), post(6));

post varchar(6), maksudnya, kan? But why the "as object" business - what 
do you expect it to do?

>  # create table id (id integer not null primary key,
>                     name char(100),address);
> now i will
> compare with this one >>
> # create table id (id integer not null primary key, name char(100));
> # create table address (id integer not null references id,
>                       address varchar(100), post(6));

Sudah lihat

http://www.postgresql.org/docs/8.0/interactive/sql-createtable.html

belum? For clarity, you're probably better off mentioning both the table 
and column in the references constraint. And what's post, again? Is it a 
type, or is it a mistyped varchar?

By the way, there isn't usually much point to using varchar(), char() 
etc - just use text; PostgreSQL always stores text efficiently, whatever 
length it is.

> which is most faster???

Faster for what, exactly? It's not clear (to me...) what you think the 
difference between your two alternatives is, except that the first one 
doesn't look like it has any hope of being understood by the database. Eg:

mus=# create table address as object(address varchar(100), post(6));
ERROR:  syntax error at or near "object" at character 25
LINE 1: create table address as object(address varchar(100), post(6)...
                                 ^


> Thank you very much for all your kind to answer my question
> and my english is so bad isn't?

Bahasa Inggrisnya lumayan, dong, cuma bahasa SQL yg wajar diragukan ;-).

> Dedy Styawan
> Semarang

Tim

-- 
-----------------------------------------------
Tim Allen          tim@proximity.com.au
Proximity Pty Ltd  http://www.proximity.com.au/



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-10-07 04:48 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-10-06 04:54 faster or ..... ???? dedy <slackman@unika.ac.id>
2005-10-06 13:25 ` Dario <dario_d_s@unitech.com.ar>
2005-10-07 04:48 ` Tim Allen <tim@proximity.com.au>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox