tmlab / majortom

The MaJorToM ( Merging Topic Maps Engine ) project was founded to develop a lightweight, merging and flexible Topic Maps engine satisfying different business use cases. The engine provides a couple of new features above to other engines based on the Topic Maps API version 2.0.
1 stars 1 forks source link

Performance of QUERY_READ_TYPE #68

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
the table topics was removed from FROM-clause

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

GoogleCodeExporter commented 9 years ago
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:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Ups. Missed something:

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

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

Attachments: