Friday, 2010-07-02

*** Dejan has joined #ingres02:56
Dejanhello everybody02:56
*** grantc has joined #ingres03:05
VroomfondleWe have a three-column primary key (let's call the columns a, b and c). If I access the table by filtering on column a *only*, Ingres will still use the primary key index, right?03:46
grantcit's certainly possible03:48
grantcis this "select a from table" where a is in an index against table for columns a,b,c?03:48
Vroomfondleit's "select * from table where a = 'blah'"03:50
Vroomfondlewhere a is the leftmost part of a multi-column key03:50
Vroomfondle(no separate index)03:50
grantcif the optimizer thinks it's better to use the index to fetch the data then it will03:52
grantcbut it depends on stats and the trade off between doing a full table scan or using the index to reduce the work it needs to do03:53
VroomfondleI've just thought of something, tbh.03:54
grantc"set qep" to see what it estimates03:54
VroomfondleThe stats are probably fecked03:54
grantc"set trace point qe90" to see the actual work done03:54
VroomfondleThis is a nightly copy database and optimizedb hasn't been run since it was refreshed.03:54
grantcthen it will assume 10% match on col = value (IIRC)03:56
grantcor is it 1% - it's been a while03:56
Dejanvroomfondle, set QEP on03:59
Dejanand check what it does04:00
grantc"set qep" is what it "thinks" it will do whilst "set trace point qe90" is what it actually did04:01
grantcwhen the output from both is wildly different you know something is wrong04:02
VroomfondleI don't really know how to read the qe90 thing. Looks like gibberish to me (lots of "et 123" and "ed 456" and "ad 789")04:04
Vroomfondlebut the QEP seems very simple - it's taking two steps04:04
DejaneX are estimated values, aX are actuals04:05
Dejanif i remember well04:05
grantcyup04:05
Dejanit just extends normal QEP04:05
Vroomfondleat     14804:06
Vroomfondleet      7604:06
Vroomfondle(etc. - aX is consistently very different from eX)04:07
Dejanit is normal04:07
Dejanbecause of: "nightly copy database and optimizedb hasn't been run since it was refreshed"04:07
Dejan(my guess)04:07
VroomfondleI'll ask for optimizedb to be run this afternoon04:07
Vroomfondlewhen we get a quiet spot to do it in04:07
grantchow  many rows are there in the table?04:11
Vroomfondleoh, bazillions. Well, a few hundred thousand.04:13
grantcso you have some stats then?04:18
Dejanyou can perhaps do optimisedb on another machine04:19
Dejanand copy statistics from it to the "original"04:20
Dejani never did so, but i know it is possible :D04:20
Vroomfondlegrantc: dunno. Will stats have been created when the data was refreshed? The copy process modifies all tables to truncated and then dumps data into them from files generated from the live database.04:26
Vroomfondle(so I'm told)04:26
grantcno the stats need to be generated manually04:38
grantcthere's not auto stat thread04:39
grantcs/not/no/04:39
*** KermitTheFragger has joined #ingres04:44
DejanKermitTheFragger, hello04:44
*** grantc has quit IRC05:12
*** grantc has joined #ingres05:14
Vroomfondlemy colleague's running an optimizedb. When the tables get truncated again tonight, will all the histograms get blasted away (and if not, will they still be valid once the data's loaded back in, apart from minor differences due to the live data having been updated a bit)?05:42
VroomfondleI guess what I'm really saying is "do we need to run optimizedb every time we replace the data overnight"?05:43
Dejani am not an expert but it sounds to me like it should be optimised again05:49
grantci guess it depends on how much the data changes05:51
*** rossand has joined #ingres05:52
*** ChanServ sets mode: +o rossand05:52
*** gerhard has joined #ingres06:03
gerhardHi all06:03
grantchi gerhard06:03
gerhardis it just me who thinks that the "patch frequency" for Ingres enterprise products has increased a lot in the last time...?06:06
gerhardexample: Ingres 9.2.1 for Linux-64 exists since end of May 2010 and there are already 3 patches for it06:09
*** mull has joined #ingres06:19
*** DarylM has joined #ingres06:21
*** gerhard has quit IRC06:42
*** atrofast has joined #ingres06:45
*** DarylM has quit IRC06:46
*** Alex| has joined #ingres09:05
*** ChanServ sets mode: +o Alex|09:05
*** Dejan has quit IRC09:27
*** bonsaikitten is now known as DrEeevil09:57
atrofastIf you have a int auto_increment col in Ingres, can you manually increment it by one?10:35
atrofastWithout inserting a row10:36
Alex|just call nextval on it11:01
Alex|if it is a new "always as identity" column, there is still a system maintained sequence with name $something11:02
Alex|or alter its start value...11:02
*** Alex| has quit IRC11:07
*** KermitTheFragger has quit IRC11:28
atrofastI got a problem with Ingres JDBC (I think)... It's a program that opens two transactions at the same time, when they're both read only it's fine but one of them tries to write it hangs12:13
atrofastAnybody ever run into this?12:13
pboroatrofast, and it's not a deadlock?12:14
atrofastNope12:14
pborowhat ingres version12:14
atrofast10.0 (svn main)12:14
pborois the program available somewhere?12:14
atrofastWell yeah, it's Geotools.. I'm working on a port to run it on Ingres12:14
atrofastSo you'd need Ingres Geospatial branch and it12:14
pborooh, haven't done much jdbc on 10.0 yet, neither on geospatial... :/12:14
atrofastgeospatial doesn't really introduce anything new... I'm just wondering if I should set up my connection differently or what not :)12:15
pborohave you checked where the driver gets stuck? you can use for example jstack to print the stacks12:15
pboroyou need debug enabled jdbc driver for jstack output to be useful12:15
atrofastWell the Ingres I have installed I built with IIOPTIM=-g12:16
atrofastNot sure if it actually builds teh JDBC driver in debug mode12:16
pborothat doesn't matter for the jdbc driver... afaik the driver is always provided as binary jar, you need to create your own version... I can do that if you wish12:17
pborocreate ie compile12:17
pboroand jstack is a tool that comes with jvm12:17
atrofastI got some jstack -l output for the PID that is hung12:17
pborocool, can you put it on pastebin or similar?12:18
atrofasthttp://ingres.pastebin.com/H58MphwK12:18
atrofastThanks for looking :)12:18
pboroluckily the stack output is pretty short :)12:19
pboroapparently the driver is trying to read the response from the server but there's something fishy with it12:20
atrofastThis is what iimonitor, show sessions looks like: http://ingres.pastebin.com/Cs6N8ftT12:21
pboroprolly a bug in DAS... or behind it :/ what does ingres tell about the session?12:21
pborothanks12:21
atrofastHeh12:21
atrofastI read your mind12:21
pborocs_state: CS_EVENT_WAIT (LOCK(TABLE,DB=4c222be0,TABLE=[15004,0]))12:22
pborothe dbms is waiting for a lock? :/12:22
pboroor how should that be read...12:22
atrofastI'm afraid I  have no clue12:22
pborois there any other sessions? apparently something else is holding the lock?12:23
pboroyou can check the lock list in ipm12:23
atrofastWell the only thing that is connected is through this JDBC driver/software... I run the test right after an ingstop;ingstart12:24
pborofrom http://docs.huihoo.com/ingres/ingres2006r2-guides/Command%20Reference%20Guide/852.htm:12:24
pboroCS_EVENT_WAIT: Indicates the session is waiting for an event. The event type is shown in parentheses, and can be any of these:12:24
pboro(LOCK)?The session is waiting for a lock to be granted.12:24
pboroso, the reason why JDBC hangs, is that DBMS is trying to get a lock on a table and it hangs the query12:25
atrofasthttp://ingres.pastebin.com/Z6Dt2CMR12:25
atrofastIs what my basic lock list looks like12:25
pborook, what about when running the Geotools and it hangs?12:25
atrofastIt hangs on this statement: DELETE FROM "road" WHERE ("fid" = '0')12:26
atrofastI think the transaction that reads from the "road" table is still open though12:27
pborolooks like it12:27
atrofastWould that lock the table and then cause teh hang?12:27
atrofastHow do I make reads not lock the table?12:27
pboroand it's keeping the table locked and causing the hang :/12:27
pborowell you could try readlock=nolock, but I'm not sure if it's a proper fix for the problem...12:28
atrofastHow do I do that in JDBC?12:28
atrofastWould I have to do a stmt.executeQuery()?12:28
pboroyou can set it in the connection parameters, lemme check12:28
pboroas soon as I can come up with proper manual page... :)12:29
atrofastThanks for checking it up for me12:30
atrofastI'm new with JDBC12:30
pborohmmh, I may remember incorrectly, you may need to use SQL for it... :/12:30
pboroyeah, no readlock parameter in http://community.ingres.com/wiki/Ingres_JDBC_Config_Utility_Documentation12:33
pboroso you need to set it either using SQL or for the whole server through CBF12:33
atrofastOkay thanks pboro!12:33
pboroyou could also try setting ingres.jdbc.property.cursor_mode=readonly in iijdbc.properties12:33
pboronot sure if it fixes the prob, but just a hint12:34
pboroI would need a dev environment and 10.0 for debugging it more properly :/12:34
atrofastI think cursor_mode=readonly is the default and that didn't work so well for me12:35
pborooh, okay :D12:35
atrofastokay well changed system_readlock to nolock in cbf, we'll see how that works12:36
atrofastif it still hangs it's something else12:36
pboroyeah... if it opens a cursor in updates-mode and doesn't close it, then it will prolly still hang...12:37
pboroi wonder why it doesn't release it, or are those two transactions related somehow?12:38
pboroI have run in some situations where the program has been designed for MVCC databases and with Ingres they always require readlock=nolock to work at all ;(12:39
atrofastInterestingly enough it now hangs one test further down12:42
pborohehe12:43
atrofastYeah this Geotools already runs on Postgres and Oracle12:43
atrofastAnd SQLServer and MySQL12:43
atrofastIt's a pretty beefy piece of software12:44
pboroyeah, those all are MVCC (MySQL if used with InnoDB, with MyISAM there's not much locks...)12:44
atrofastThe test specifically tests concurrency12:44
pboroheehee... maybe it expects MVCC features :D12:44
pboroyou could investigate the tests more in detail to find out the actual problem if you wish... it probably boils down to locks and concurrent cursors on the same tables :/12:45
atrofastYeah that's what I'm suspecting12:45
pboroMVCC should be included in 10.0, you could try enabling it and see if it makes any difference12:46
pborohttp://community.ingres.com/wiki/MVCC_User_Guide12:46
pboroand... http://community.ingres.com/wiki/MVCC_User_Guide#Enabling_It_At_The_System_Level12:46
atrofastHmm cbf doesn't allow me to set system_lock_level to mvcc... I just edited config.dat and changed it there12:50
atrofastThis is my first try with MVCC :)12:51
atrofastWe just recently merged the latest changes from main into geospatial12:52
atrofastOh another thing, geotools assumes auto_commit is on so I set AUTO=MULTI in my connection string12:53
pborowtf, assumes auto_commit is on?! okay...12:55
pboroI would expect JDBC program to set the autocommit state by itself instead of expecting it to be something12:56
atrofastHmm wait you might actualyl be right there :)12:56
pboroie. by calling setAutoCommit(true) or setAutoCommit(false)... not doing so would be pretty weird :)12:56
atrofastOkay MVCC turned on, readlock=shared and it hangs in the same place12:58
atrofastI guess I just gotta do readlock=nolock12:58
pboroyeah12:59
pborohmm btw what is your isolation level?12:59
pboroiirc the default for Ingres is serializable, which is a bit overkill for most applications and also a probable cause for the hang13:00
atrofastYeah I didn't change that13:07
atrofastWhat do you recommend? read_uncommitted?13:07
pbororead_committed is pretty usual default for mvcc databases like oracle and postgresql13:07
pboroi don't know any other dbms than ingres that defaults to serializable anyway...13:08
pboroserializable means pretty low concurrency :/ it could even be the original cause of the problem...13:10
atrofastI'll try that13:10
atrofastThat setting is the same right? Either change it in cbf/config.dat or execute a query set isolation level = read_committed or wahtever the syntax is?13:10
pboroyup13:12
atrofastNo difference setting it to read_committed :(13:16
atrofastThe only thing that seems to make any difference is readlock=nolock13:16
pborookay, weird13:21
atrofastThanks for helping me out pboro, much appreciated13:41
*** DarylM has joined #ingres14:16
*** atrofast has quit IRC14:42
*** mull has quit IRC15:00
*** Vroomfondle has quit IRC15:38
*** Vroomfondle has joined #ingres15:41
*** grantc has quit IRC15:52
*** mull has joined #ingres18:05
*** cytrinox_ has joined #ingres19:20
*** cytrinox has quit IRC19:21
*** cytrinox_ is now known as cytrinox19:21
*** DarylM has quit IRC20:49
*** rossand has quit IRC22:26
*** DerMeister has joined #ingres23:02
*** Alex| has joined #ingres23:18
*** ChanServ sets mode: +o Alex|23:18

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