tmlab/majortom

Performance of QUERY_READ_TYPE

GoogleCodeExporter opened this issue · 6 comments

QUERY_READ_TYPE is defined as:

SELECT id_type FROM typeables AS ty, topics AS t WHERE ty.id = ?

Why is there the ",topics AS t" part? Running this query returns a list of type 
ids where the value is exactly the given parameter. Huh? Don't know what this 
means. 

See: 
http://code.google.com/p/majortom/source/browse/majortom-db/src/main/java/de/top
icmapslab/majortom/database/jdbc/postgres/sql99/query/ISql99SelectQueries.java#5
02




Original issue reported on code.google.com by MarcelHoyer@gmail.com on 25 Oct 2010 at 12:27

[deleted comment]
No, thats wrong, running this query returns exactly one biginteger value 
representing the primary key of the topic tuple.

scenario:

Topic t1 => ID : 1
Name n1 => ID : 2 => Type : t1

In this case the query returns the ID 1 and never a list.

But you are right, that the from part for topics could be removed.

Original comment by Sven.Kro...@googlemail.com on 25 Oct 2010 at 1:52

the table topics was removed from FROM-clause

Original comment by Sven.Kro...@googlemail.com on 25 Oct 2010 at 1:54

  • Changed state: Fixed
Great!

I did some log analyzing (with pgfuoine [1]) on the Postgres queries while 
using Maiana with MT-DB backend. I just opened the ToyTM, and navigated to:

 * 'Berlin' topic
 * 'Master Index'
 * 'Index of Individuals'
 * 'Index of Themes' 
 * 'Unnamed Topics'
 * Query with TMQL -> '/ topic::*'

The results of the analysis is attached: maiana-without-index.html

Then I tried to use the pgAdmin Query Analyzer to find performance issues. I 
fixed some of the slowest queries by adding indexes to the schema (see 
MaJorToM-indexes.sql) and ran the upper test scenario again. The results of 
this analysis are represented with: maiana-with-index.html

Original comment by MarcelHoyer@gmail.com on 25 Oct 2010 at 1:58

Attachments:

[deleted comment]
Ups. Missed something:

[1] http://pgfouine.projects.postgresql.org/

Original comment by MarcelHoyer@gmail.com on 25 Oct 2010 at 2:01

Attachments: