Monday, 2010-07-05

*** gerhard has joined #ingres00:00
*** Mud has joined #ingres00:09
*** grantc has joined #ingres00:14
*** Dejan has joined #ingres01:20
gerhardHi all01:23
grantcmorning gerhard01:23
Dejanhello everyone01:26
gerhardIt's nice that the Ingres KB articles are available now without being logged into the service desk. Also nice that it is now possible to make a browser bookmark for an article.01:29
Dejanreally ?01:35
Dejanthere is one article from john smedley i would like to steal01:35
Dejanabout perfromance tuning01:35
grantcwww.ingres.com/kb01:37
Dejangod01:38
Dejanthis is brilliant01:38
Dejan:D01:38
Vroomfondlehow queer: I have two tables, A and B. Both have the same key. A has one row in it. If I join B on A with INNER JOIN, the query takes > 10 seconds. If I rewrite the query and copy-paste the value from A into "select * from B where keycolumn = 'value_from_A'", the query runs instantly.02:38
Vroomfondleindexes on both look fine02:38
VroomfondleI guess I might have to learn how to actually read a QEP properly02:40
Vroomfondleit looks like the QEP for the join involves a sort on 9983 pages' worth of B, even though the column that I'm joining on is the leftmost part of the key for the table.02:41
Dejanthe order is important in sql02:43
Vroomfondleoh, the index for that table is stored as ISAM02:43
Vroomfondlecould that be the cause of the performance problem?02:43
Dejanyou said A has 1 row??02:43
Dejanright?02:43
Vroomfondleyes.02:44
VroomfondleA has one row, B has lots of rows02:44
Vroomfondle(about a million)02:44
DejanA inner join B is not the same as select * from B where keycolumn=value...02:45
Dejanright?02:45
Vroomfondleindeed02:45
grantcif the stats are missing cola = col b is assumed to be 10%02:46
Vroomfondleit would appear that the key index is used when using WHERE, but when using JOIN it's using a separate index02:46
grantccola = value  is 1% iirc02:46
Vroomfondlewe tried building the stats on Friday. It made no difference.02:48
VroomfondleIn fact, my test afterwards actually ran *slower* but that might've been due to system load02:48
Vroomfondleand I'm wrong about the indexes, actually. It's using the same index for both. I'm gonna try modifying it to btree.02:49
Vroomfondlehrm... that didn't help much, if at all03:04
grantcwhat about a index that just includes that column03:05
Vroomfondleworth a try I guess03:06
Vroomfondledoesn't seem to have helped03:08
Vroomfondlethe only difference in the query plans appears to be the sort. If I JOIN, it sorts the index before joining. If I use WHERE x=y, it doesn't do a sort.03:09
Dejandid you try to JOIN with USING clause?03:22
Dejanit may make a difference03:23
VroomfondleI'm just doing INNER JOIN tableB b on b.x = a.x03:25
Dejantry INNER JOIN B USING (x)03:26
Vroomfondlestill does the sort03:27
VroomfondleI have a hypothesis which I'm about to test, though. Table A is a heap (I thought that'd make no difference as it only has one row). I'll try modifying it to an ISAM or a BTREE and see if that makes a difference.03:28
*** javahorn_ has joined #ingres03:31
*** javahorn_ has quit IRC03:57
*** atrofast has joined #ingres04:44
*** atrofast has quit IRC05:03
*** cthibert has joined #ingres05:05
*** atrofast has joined #ingres05:06
*** cthibert1 has joined #ingres05:08
*** atrofast has left #ingres05:09
*** atrofast has joined #ingres05:09
*** cthibert has quit IRC05:10
*** rossand has joined #ingres05:26
*** ChanServ sets mode: +o rossand05:26
* Vroomfondle replaces his joins with select loops, and now his code takes 1/5th of the time to execute05:36
pboro:-o05:36
pborothat's sad05:36
pboroI like JOINs because of they are so readable05:36
Vroomfondleme too. However it seems that Ingres sorts both indexes which are involved in the join, and if one of the indexes is big then that adds a huge overhead to the query (on our system, at least).05:36
pborodoes that mean it wont use the index at all?05:36
pboroor what happens then05:37
Vroomfondleit does use the index, but the sort seems to take a while05:39
Vroomfondleabout ten seconds in this case05:40
pboroweird...05:40
pborowhat kind of join is it using?05:41
Vroomfondleinner join05:41
pborodid you check qep?05:41
Vroomfondleyes, that's how I found this out05:41
pboroyeah but the technical algo :)05:41
Vroomfondleoh. FSM05:41
pborodo you have hash joins disabled?05:42
VroomfondleI have no idea. How do I find out?05:42
pborocheck config.dat and the value for opf_hash_join05:43
pboroand which ingres version?05:43
Vroomfondleyeah, it's off.05:43
Vroomfondle9.2.05:43
pboroit's an upgrade? not a clean install?05:44
VroomfondleI don't know for sure. I'm not in charge of that kind of thing. I *think* we only ever do clean installs.05:44
Vroomfondleis a hash join better? I've reached the limits of my knowledge here05:45
pboroyou could try if running the query with "SET HASH" and see if it makes any difference on the query time and QEP05:46
pboroie. first run SET HASH; in the session and then the query05:46
pboroopf_hash_join defaults to on afaik05:46
pboroyeah FSM is the "old-type" join way and hash is used if it's applicable and opf_hash_join is not disabled05:47
pborohash joins are also being enhanced... for example http://community.ingres.com/wiki/Performance_Enhancements#SIR_122512:_Hash-join.2C_Hash-agg_improvements05:47
*** cthibert has joined #ingres05:49
*** cthibert1 has quit IRC05:49
Vroomfondlehrm. I did SET HASH then SET QEP then my query05:49
Vroomfondleit's still using FSM05:49
pborook05:49
pboroFSM stands for Full Sort Merge... here's an explanation of joins: http://docs.ingres.com/Ingres/9.2/Database%20Administrator%20Guide/typesofnodesinaqep.htm#o228305:52
pborowhat join type or similar does it use when you do it traditionally (where col1.id = col2.id)?05:52
Vroomfondlesame thing05:53
pboroFSM in both cases? :o05:53
Vroomfondleyup05:53
pboroit's pretty weird that there's a differences between JOIN and traditional way of doing join05:57
pborosince I have understood that JOIN would be broken into pieces similar to traditional join for execution, but apparently it's not the case05:58
VroomfondleI wonder if there's something else in our configuration that's forcing the FSM algorithm to be used06:14
pboroif you have support contract, then just create a request :)06:14
Vroomfondleyeah, think I'll raise a ticket06:25
pborosince it's easy to reproduce, there should not be a problem in investigating it06:25
*** cthibert1 has joined #ingres06:30
*** cthibert has quit IRC06:32
*** Mud has quit IRC07:03
*** gerhard has quit IRC07:30
*** Alex| has quit IRC07:33
*** Mud has joined #ingres07:46
*** atrofast has quit IRC08:16
*** atrofast has joined #ingres08:20
*** dyki has joined #ingres08:21
*** atrofast has quit IRC08:27
*** atrofast has joined #ingres08:29
*** atrofast has quit IRC08:30
*** atrofast has joined #ingres08:32
*** dyki has quit IRC08:49
*** grantc has quit IRC08:51
*** Alex| has joined #ingres09:53
*** ChanServ sets mode: +o Alex|09:53
*** Dejan has quit IRC10:20
*** rossand has quit IRC11:14
*** rossand has joined #ingres11:15
*** ChanServ sets mode: +o rossand11:15
*** atrofast has quit IRC12:56
*** atrofast has joined #ingres13:00
*** DerMeister has joined #ingres13:08
*** atrofast has quit IRC13:14
*** atrofast has joined #ingres13:17
*** rossand has quit IRC13:40
*** cthibert1 has left #ingres13:49
*** Mud has quit IRC13:55
*** Alex| has quit IRC14:08
*** DerMeister has quit IRC14:25
*** atrofast has quit IRC16:57
*** cytrinox_ has joined #ingres19:20
*** cytrinox has quit IRC19:23
*** cytrinox_ is now known as cytrinox19:23
*** Mud has joined #ingres21:40
*** Alex| has joined #ingres22:39
*** ChanServ sets mode: +o Alex|22:39
*** Alex| has quit IRC23:25
*** Alex| has joined #ingres23:57
*** ChanServ sets mode: +o Alex|23:57
*** Alex| has quit IRC23:58
*** Alex| has joined #ingres23:58
*** ChanServ sets mode: +o Alex|23:58

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!