Re: Abnormal performance difference between Postgres and MySQL

From: Claus Guttesen <kometen(at)gmail(dot)com>
To: Farhan Husain <russoue(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Abnormal performance difference between Postgres and MySQL
Date: 2009-02-24 20:55:22
Message-ID: b41c75520902241255k678922c8med6e0028a51bb39e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

>> > Query:
>> >
>> > select A0.Subj, A2.Obj From jena_g1t1_stmt A0, jena_g1t1_stmt A1,
>> > jena_g1t1_stmt A2 Where
>> > A0.Prop='Uv::http://prismstandard.org/namespaces/1.2/basic/isPartOf' AND
>> >
>> > A0.Obj='Uv::http://www.utdallas.edu/~farhan.husain/IngentaConnect/issue1_1'
>> > AND A0.GraphID=1 AND A0.Subj=A1.Subj AND
>> > A1.Prop='Uv::http://www.w3.org/1999/02/22-rdf-syntax-ns#type' AND
>> > A1.Obj='Uv::http://metastore.ingenta.com/ns/structure/Article' AND
>> > A1.GraphID=1 AND A0.Subj=A2.Subj AND
>> > A2.Prop='Uv::http://prismstandard.org/namespaces/1.2/basic/startingPage'
>> > AND
>> > A2.GraphID=1;
>> >
>> > Table:
>> >
>> >         Table "public.jena_g1t1_stmt"
>> >  Column  |          Type          | Modifiers
>> > ---------+--------------------
>> > ----+-----------
>> >  subj    | character varying(250) | not null
>> >  prop    | character varying(250) | not null
>> >  obj     | character varying(250) | not null
>> >  graphid | integer                |
>> > Indexes:
>> >     "jena_g1t1_stmt_ixo" btree (obj)
>> >     "jena_g1t1_stmt_ixsp" btree (subj, prop)
>>
>> Isn't it missing an index on the column prop?
>>
>> select ... where A0.Prop='foo' and ...
>> --
> Can you please elaborate a bit?

I thought that A0.Prop would ignore the composite index created on the
columns subj and prop but this does not seem to be the case.

--
regards
Claus

When lenity and cruelty play for a kingdom,
the gentler gamester is the soonest winner.

Shakespeare

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Haas 2009-02-25 02:21:11 Re: Abnormal performance difference between Postgres and MySQL
Previous Message Farhan Husain 2009-02-24 19:52:14 Re: Abnormal performance difference between Postgres and MySQL