*** cytrinox has quit IRC | 00:40 | |
*** cytrinox has joined #ingres | 00:42 | |
*** Alex| has joined #ingres | 03:05 | |
*** ChanServ sets mode: +o Alex| | 03:05 | |
*** Alex| has quit IRC | 04:02 | |
*** Mud has joined #ingres | 06:58 | |
*** sehh has quit IRC | 08:33 | |
*** Alex| has joined #ingres | 09:01 | |
*** ChanServ sets mode: +o Alex| | 09:01 | |
*** Mud has quit IRC | 10:12 | |
*** Mud has joined #ingres | 10:16 | |
*** Dejan has joined #ingres | 10:48 | |
*** Alex| has quit IRC | 11:10 | |
*** cytrinox_ has joined #ingres | 11:11 | |
*** cytrinox has quit IRC | 11:13 | |
*** cytrinox_ is now known as cytrinox | 11:13 | |
*** Alex| has joined #ingres | 11:23 | |
*** ChanServ sets mode: +o Alex| | 11:23 | |
*** sehh has joined #ingres | 12:02 | |
sehh | hey people | 12:02 |
---|---|---|
*** cytrinox has quit IRC | 12:06 | |
*** cytrinox has joined #ingres | 12:08 | |
sehh | q: how can I emulate the FOUND_ROWS() function as used by MySQL under Ingres? | 12:31 |
sehh | my application is heavily dependent on this function for pagination | 12:32 |
*** cytrinox has quit IRC | 12:40 | |
*** cytrinox has joined #ingres | 12:41 | |
Dejan | that will teach you that if you want your app to be portable you use only ANSI SQL statements... | 12:44 |
Dejan | ANSI/ISO | 12:45 |
Dejan | :) | 12:45 |
*** Dejan has quit IRC | 12:45 | |
sehh | indeed, but this is not my application, so I have to work with what I have | 12:47 |
Vroomfondle | not sure you can, without adding in a count(*) to the query | 13:15 |
Vroomfondle | and even that might not work | 13:15 |
sehh | hmm | 13:22 |
sehh | that is definitely a problem | 13:23 |
sehh | every select query uses found_rows() for pagination | 13:23 |
sehh | how do you do pagination with Ingres? this is one of the most important features of a database! | 13:23 |
sehh | Vroomfondle, do you know if Ingres supports regular expressions? I tried REGEXP but it failed | 13:24 |
Vroomfondle | I'm not sure how pagination is usually done - our system makes very little use of it I'm afraid | 13:26 |
Vroomfondle | likewise we don't tend to do regexes in queries (they're generally in the PHP, if anywhere) | 13:27 |
Vroomfondle | I don't *think* Ingres supports regex in any way but I could be wrong | 13:28 |
*** Mud has quit IRC | 14:11 | |
*** Mud has joined #ingres | 14:17 | |
sehh | hmm | 15:07 |
sehh | seems like Ingres doesn't support regular expressions | 15:07 |
sehh | and I can't find a way to make pagination calculations | 15:07 |
sehh | I'm sure there must be a way, I can't imagine a database that can't do pagination | 15:08 |
sehh | well | 15:58 |
sehh | I can compensate regexp by using LIKE | 15:58 |
sehh | but the found_rows() is a serious issue | 15:59 |
Vroomfondle | if 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 |
Vroomfondle | it does mean an extra UPDATE whenever someone adds a <whatever item> though and could lead to concurrency issues | 16:05 |
sehh | well, 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 parameters | 16:25 |
sehh | heh Ingres just crashed :) | 16:25 |
Vroomfondle | heh. That's fairly unusual unless you're hammering it. What're the symptoms? | 16:26 |
sehh | I'm doing a select statement with FIRST and OFFSET | 16:26 |
Vroomfondle | and 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 |
sehh | either my ingres has a buggy OFFSET or the documentation is completely wrong about what it does | 16:27 |
Vroomfondle | offset is pretty new | 16:27 |
Vroomfondle | it may be buggy, I guess. It's new enough that we don't use it at all yet. | 16:27 |
sehh | well, its one of the most important things for pagination | 16:28 |
sehh | when you request page 5 | 16:28 |
sehh | the system checks the limit of items per page | 16:28 |
sehh | and divides that to the total rows | 16:28 |
Vroomfondle | well.. 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.2 | 16:28 |
Vroomfondle | *that I just did | 16:28 |
sehh | then uses FIRST and OFFSET to get the results for page 5 only | 16:28 |
Vroomfondle | yeah, seems reasonable | 16:28 |
sehh | erm | 16:29 |
sehh | yeah I just managed to reproduce the crash | 16:30 |
Vroomfondle | we 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 |
Vroomfondle | I had to tell him to rewrite it because the serialised array was about thirty megabytes and it was upsetting PHP. | 16:31 |
sehh | oaw thats very very bad coding, it could brake in 10 different ways.. like reach the POST size limit, etc | 16:31 |
*** Alex| has quit IRC | 16:31 | |
sehh | ouch | 16:31 |
Vroomfondle | to 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 app | 16:32 |
sehh | heh | 16:32 |
sehh | the forums say this should work: | 16:39 |
sehh | SELECT col FROM table FETCH FIRST 10 OFFSET 5 | 16:39 |
sehh | but my ingres says its wrong | 16:39 |
sehh | oh well | 16:39 |
Vroomfondle | you're on 9.4, right | 16:40 |
Vroomfondle | ? | 16:40 |
sehh | yes | 16:40 |
Vroomfondle | why? | 16:40 |
sehh | because thats what I've been given to work with | 16:40 |
Vroomfondle | hmmm... you working for a chinese company by any chance? | 16:40 |
sehh | its a database that I am forced to use in order to convert my PHP app | 16:40 |
sehh | heh no, European | 16:40 |
sehh | uses ISO-8859-1 encoding if that matters | 16:41 |
Vroomfondle | IIRC, 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 |
Vroomfondle | 9.4 certainly wasn't an official release and I would imagine Ingres wouldn't recommend it for general use... | 16:41 |
Vroomfondle | certainly when we inquired about 9.3 we were told by them not to use it (wait for 10.0) | 16:42 |
sehh | hmm | 16:42 |
Vroomfondle | if you go to the downloads site ( | 16:43 |
Vroomfondle | esd.ingres.com) you'll note it's not listed | 16:43 |
Vroomfondle | though a google search reveals some code | 16:43 |
sehh | hmm | 16:44 |
sehh | well | 16:44 |
sehh | I can't do much about it, thats what I have to work with | 16:44 |
Vroomfondle | I'm sure... just expect to hit bugs ;) | 16:45 |
sehh | at least I can reliably reproduce the crash | 16:45 |
sehh | well, I also discovered that "FIRST" is not like the LIMIT in MySQL | 16:50 |
sehh | damn | 16:50 |
sehh | so its not possible to take the "middle" of the result set | 16:50 |
Vroomfondle | I 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 |
Vroomfondle | they 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 googling | 16:51 |
Vroomfondle | I'd've thought you could but as usual the Ingres documentation is being obtuse and not telling me what I want to know | 16:52 |
sehh | seems like Ingres is lacking basic SQL commands that other databases have had for years... | 16:55 |
Vroomfondle | well... 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 |
Vroomfondle | but yeah, it is quite lacking in convenience functions. | 16:56 |
Vroomfondle | I 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 |
Vroomfondle | though that was a long time ago | 16:57 |
sehh | well | 17:02 |
sehh | a database without regular expressions is just plain useless | 17:02 |
sehh | jesus man, NO regular expressions??? I mean what the fuck are these people smoking... | 17:02 |
sehh | I'm not saying they should join us in the 21st century... but at least join us in the 20th!!! | 17:03 |
*** Mud has quit IRC | 17:37 | |
*** Roy_ has joined #ingres | 18:37 | |
*** stliu has joined #ingres | 23:53 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!