pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedView & Query Performance
3+ messages / 3 participants
[nested] [flat]
* View & Query Performance
@ 2004-10-14 21:02 Igor Maciel Macaubas <igor@providerst.com.br>
0 siblings, 2 replies; 3+ messages in thread
From: Igor Maciel Macaubas @ 2004-10-14 21:02 UTC (permalink / raw)
To: pgsql-performance
Hi all,
I'm trying to find smarter ways to dig data from my database, and have the following scenario:
table1
-- id
-- name
.
.
.
.
.
.
table2
-- id
-- number
.
.
.
.
.
.
I want to create a view to give me back just what I want:
The id, the name and the number.
I tought in doing the following:
create view my_view as select t1.id, t1.name, t2.number from table1 as t1, table2 as t2 where t1.id = t2.id;
Will this be enough fast ? Are there a faster way to make it work ?!
This table is mid-big, around 100K registers ..
Regards,
Igor
--
igor@providerst.com.br
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: View & Query Performance
@ 2004-10-15 07:28 Alban Medici (NetCentrex) <amedici@fr.netcentrex.net>
parent: Igor Maciel Macaubas <igor@providerst.com.br>
1 sibling, 0 replies; 3+ messages in thread
From: Alban Medici (NetCentrex) @ 2004-10-15 07:28 UTC (permalink / raw)
To: 'Igor Maciel Macaubas' <igor@providerst.com.br>; pgsql-performance
Can you tell us more about the structure of your tables,
witch sort of index did you set on witch fields ?
Did you really need to get ALL records at once, instead you may be could use
paging (cursor or SELECT LIMIT OFFSET ) ?
And did you well configure your .conf ?
Regards
Alban Médici
_____
From: pgsql-performance-owner@postgresql.org
[mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Igor Maciel
Macaubas
Sent: jeudi 14 octobre 2004 23:03
To: pgsql-performance@postgresql.org
Subject: [PERFORM] View & Query Performance
Hi all,
I'm trying to find smarter ways to dig data from my database, and have the
following scenario:
table1
-- id
-- name
.
.
.
.
.
.
table2
-- id
-- number
.
.
.
.
.
.
I want to create a view to give me back just what I want:
The id, the name and the number.
I tought in doing the following:
create view my_view as select t1.id, t1.name, t2.number from table1 as t1,
table2 as t2 where t1.id = t2.id;
Will this be enough fast ? Are there a faster way to make it work ?!
This table is mid-big, around 100K registers ..
Regards,
Igor
--
igor@providerst.com.br
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: View & Query Performance
@ 2004-10-15 07:37 Richard Huxton <dev@archonet.com>
parent: Igor Maciel Macaubas <igor@providerst.com.br>
1 sibling, 0 replies; 3+ messages in thread
From: Richard Huxton @ 2004-10-15 07:37 UTC (permalink / raw)
To: Igor Maciel Macaubas <igor@providerst.com.br>; +Cc: pgsql-performance
Igor Maciel Macaubas wrote:
> Hi all,
>
> I'm trying to find smarter ways to dig data from my database, and
> have the following scenario:
>
> table1 -- id -- name . . . . . .
>
> table2 -- id -- number . . . . . .
>
> I want to create a view to give me back just what I want: The id, the
> name and the number. I tought in doing the following: create view
> my_view as select t1.id, t1.name, t2.number from table1 as t1, table2
> as t2 where t1.id = t2.id;
>
> Will this be enough fast ? Are there a faster way to make it work ?!
> This table is mid-big, around 100K registers ..
That's as simple a way as you will find. If you apply further
conditions, e.g.
SELECT * FROM my_view WHERE id = 123;
then you should see any index on "id" being used.
--
Richard Huxton
Archonet Ltd
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2004-10-15 07:37 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-10-14 21:02 View & Query Performance Igor Maciel Macaubas <igor@providerst.com.br>
2004-10-15 07:28 ` Alban Medici (NetCentrex) <amedici@fr.netcentrex.net>
2004-10-15 07:37 ` Richard Huxton <dev@archonet.com>
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