From: | Richard Huxton <dev(at)archonet(dot)com> |
---|---|
To: | Igor Maciel Macaubas <igor(at)providerst(dot)com(dot)br> |
Cc: | pgsql-performance(at)postgresql(dot)org |
Subject: | Re: View & Query Performance |
Date: | 2004-10-15 07:37:06 |
Message-ID: | 416F7E22.6000702@archonet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Simon Riggs | 2004-10-15 07:55:59 | Re: [Testperf-general] Re: First set of OSDL Shared Memscalability results, some wierdness ... |
Previous Message | Alban Medici (NetCentrex) | 2004-10-15 07:28:18 | Re: View & Query Performance |