Sunday, 2011-07-03

*** cytrinox has quit IRC00:40
*** cytrinox has joined #ingres00:42
*** Alex| has joined #ingres03:05
*** ChanServ sets mode: +o Alex|03:05
*** Alex| has quit IRC04:02
*** Mud has joined #ingres06:58
*** sehh has quit IRC08:33
*** Alex| has joined #ingres09:01
*** ChanServ sets mode: +o Alex|09:01
*** Mud has quit IRC10:12
*** Mud has joined #ingres10:16
*** Dejan has joined #ingres10:48
*** Alex| has quit IRC11:10
*** cytrinox_ has joined #ingres11:11
*** cytrinox has quit IRC11:13
*** cytrinox_ is now known as cytrinox11:13
*** Alex| has joined #ingres11:23
*** ChanServ sets mode: +o Alex|11:23
*** sehh has joined #ingres12:02
sehhhey people12:02
*** cytrinox has quit IRC12:06
*** cytrinox has joined #ingres12:08
sehhq: how can I emulate the FOUND_ROWS() function as used by MySQL under Ingres?12:31
sehhmy application is heavily dependent on this function for pagination12:32
*** cytrinox has quit IRC12:40
*** cytrinox has joined #ingres12:41
Dejanthat will teach you that if you want your app to be portable you use only ANSI SQL statements...12:44
DejanANSI/ISO12:45
Dejan:)12:45
*** Dejan has quit IRC12:45
sehhindeed, but this is not my application, so I have to work with what I have12:47
Vroomfondlenot sure you can, without adding in a count(*) to the query13:15
Vroomfondleand even that might not work13:15
sehhhmm13:22
sehhthat is definitely a problem13:23
sehhevery select query uses found_rows() for pagination13:23
sehhhow do you do pagination with Ingres? this is one of the most important features of a database!13:23
sehhVroomfondle, do you know if Ingres supports regular expressions? I tried REGEXP but it failed13:24
VroomfondleI'm not sure how pagination is usually done - our system makes very little use of it I'm afraid13:26
Vroomfondlelikewise we don't tend to do regexes in queries (they're generally in the PHP, if anywhere)13:27
VroomfondleI don't *think* Ingres supports regex in any way but I could be wrong13:28
*** Mud has quit IRC14:11
*** Mud has joined #ingres14:17
sehhhmm15:07
sehhseems like Ingres doesn't support regular expressions15:07
sehhand I can't find a way to make pagination calculations15:07
sehhI'm sure there must be a way, I can't imagine a database that can't do pagination15:08
sehhwell15:58
sehhI can compensate regexp by using LIKE15:58
sehhbut the found_rows() is a serious issue15:59
Vroomfondleif we had to do anything like that in our app we'd probably just have a little table which keeps a count of <whatever item>16:04
Vroomfondleit does mean an extra UPDATE whenever someone adds a <whatever item> though and could lead to concurrency issues16:05
sehhwell, this is not realistic for an application that does combined searches and displays the result to the end user, and allows them to sort the results by various parameters16:25
sehhheh Ingres just crashed :)16:25
Vroomfondleheh. That's fairly unusual unless you're hammering it. What're the symptoms?16:26
sehhI'm doing a select statement with FIRST and OFFSET16:26
Vroomfondleand yeah, I can see your problem. The app I work on is a Student Data System and the users generally know what they're after (eg "I want to enter marks for course xyz") so we don't often display big lists of things (with a few exceptions)16:26
sehheither my ingres has a buggy OFFSET or the documentation is completely wrong about what it does16:27
Vroomfondleoffset is pretty new16:27
Vroomfondleit may be buggy, I guess. It's new enough that we don't use it at all yet.16:27
sehhwell, its one of the most important things for pagination16:28
sehhwhen you request page 516:28
sehhthe system checks the limit of items per page16:28
sehhand divides that to the total rows16:28
Vroomfondlewell.. actually it's not *that* new according to the google search that did (Ingres 9.2 so a few years ago), but we only just upgraded to 9.216:28
Vroomfondle*that I just did16:28
sehhthen uses FIRST and OFFSET to get the results for page 5 only16:28
Vroomfondleyeah, seems reasonable16:28
sehherm16:29
sehhyeah I just managed to reproduce the crash16:30
Vroomfondlewe do have one page that I can think of off the top of my head which does pagination but it's in the most horrendous way possible. In fact since I took charge of our web app I've had to tell my colleague to try to rewrite it. It does one huge SELECT at the start and then, to prevent further queries, passes the entire rowset via a serialised array in POST. No, seriously.16:30
VroomfondleI had to tell him to rewrite it because the serialised array was about thirty megabytes and it was upsetting PHP.16:31
sehhoaw thats very very bad coding, it could brake in 10 different ways.. like reach the POST size limit, etc16:31
*** Alex| has quit IRC16:31
sehhouch16:31
Vroomfondleto be fair it was his first ever go at PHP and for some reason my former boss thought it was a good idea for him to cut his teeth on one of the most complicated parts of the app16:32
sehhheh16:32
sehhthe forums say this should work:16:39
sehhSELECT col FROM table FETCH FIRST 10 OFFSET 516:39
sehhbut my ingres says its wrong16:39
sehhoh well16:39
Vroomfondleyou're on 9.4, right16:40
Vroomfondle?16:40
sehhyes16:40
Vroomfondlewhy?16:40
sehhbecause thats what I've been given to work with16:40
Vroomfondlehmmm... you working for a chinese company by any chance?16:40
sehhits a database that I am forced to use in order to convert my PHP app16:40
sehhheh no, European16:40
sehhuses ISO-8859-1 encoding if that matters16:41
VroomfondleIIRC, and I only heard this indirectly so I may be wrong, 9.4 was knocked up quickly prior to 10.0 because Ingres had a big asian client who wanted a new release for a big project they were working on with Ingres.16:41
Vroomfondle9.4 certainly wasn't an official release and I would imagine Ingres wouldn't recommend it for general use...16:41
Vroomfondlecertainly when we inquired about 9.3 we were told by them not to use it (wait for 10.0)16:42
sehhhmm16:42
Vroomfondleif you go to the downloads site (16:43
Vroomfondleesd.ingres.com) you'll note it's not listed16:43
Vroomfondlethough a google search reveals some code16:43
sehhhmm16:44
sehhwell16:44
sehhI can't do much about it, thats what I have to work with16:44
VroomfondleI'm sure... just expect to hit bugs ;)16:45
sehhat least I can reliably reproduce the crash16:45
sehhwell, I also discovered that "FIRST" is not like the LIMIT in MySQL16:50
sehhdamn16:50
sehhso its not possible to take the "middle" of the result set16:50
VroomfondleI haven't played with these so I can't say if they'll be useful, but see if you can find out about scrollable cursors?16:51
Vroomfondlethey are available in Ingres and it strikes me you *might* be able to do something with them... *if* you can scroll without retrieving, which I can't quite figure out by googling16:51
VroomfondleI'd've thought you could but as usual the Ingres documentation is being obtuse and not telling me what I want to know16:52
sehhseems like Ingres is lacking basic SQL commands that other databases have had for years...16:55
Vroomfondlewell... possibly. I sometimes think that but then I find out that those SQL commands aren't actually (standard) SQL commands. Ingres tends to stick to the standards fairly closely.16:56
Vroomfondlebut yeah, it is quite lacking in convenience functions.16:56
VroomfondleI dunno if it's a symptom of the fact that Ingres was designed for QUEL, not SQL, and they spent many years pushing QUEL before they gave up (so I hear)16:57
Vroomfondlethough that was a long time ago16:57
sehhwell17:02
sehha database without regular expressions is just plain useless17:02
sehhjesus man, NO regular expressions??? I mean what the fuck are these people smoking...17:02
sehhI'm not saying they should join us in the 21st century... but at least join us in the 20th!!!17:03
*** Mud has quit IRC17:37
*** Roy_ has joined #ingres18:37
*** stliu has joined #ingres23:53

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