| From: | Vijay Deval <deval(at)giaspn01(dot)vsnl(dot)net(dot)in> | 
|---|---|
| To: | Lukas Ertl <l(dot)ertl(at)univie(dot)ac(dot)at> | 
| Cc: | pgsql-novice(at)postgresql(dot)org | 
| Subject: | Re: Query performance question | 
| Date: | 2001-03-29 16:20:17 | 
| Message-ID: | 3AC360C1.D53546E8@giaspn01.vsnl.net.in | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-novice | 
As the tables are linked by
WHERE hits.referrer_id =referrer.id
just adding to select referrer.url should display url
I did not see right away that referrer.id was unique. Hence the
suggestion to add a
unique ID for the tuples.
Vijay
Lukas Ertl wrote:
> On Thu, 29 Mar 2001, Vijay Deval wrote:
>
> > URL is a very large field.  If an extra field is created which gives
a
> > neumeric id to the url, run the query on the number, and then get
the desired
> > output
>
> I have to admit, that I quite don't understand what you want me to do
> here... I already have that numeric id:
>
> > > httplog=# \d referrer
> > >           Table "referrer"
> > >  Attribute |     Type     | Modifier
> > > -----------+--------------+----------
> > >  id        | integer      |
> > >  url       | varchar(300) |
> > > Index: referrer_pkey
>
> If I say:
>
> SELECT count(*), referrer.id FROM hits, referrer WHERE referrer.id =
> referrer_id GROUP BY referrer.id ORDER BY count DESC LIMIT 10;
>
> it is really fast and I get the IDs of the referrer-urls but how would
I
> get the URLs then?
>
> regards,
> le
>
> --
> Lukas Ertl                          eMail: l(dot)ertl(at)univie(dot)ac(dot)at
> WWW-Redaktion                       Tel.:  (+43 1) 4277-14073
> Zentraler Informatikdienst (ZID)    Fax.:  (+43 1) 4277-9140
> der Universität Wien
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Patrick Coulombe | 2001-03-29 18:59:46 | 3 options | 
| Previous Message | D. Duccini | 2001-03-29 10:51:08 | Re: Query performance question |