Re: [HACKERS] Speeding up the Postgres lexer

2005-06-06 Thread Simon Riggs
On Wed, 2005-05-25 at 11:28 +1000, Neil Conway wrote: Tom Lane wrote: Dunno. Depending on such a thing would require depending on a new flex version, and seeing that the flex guys haven't put out a new release since the badly broken 2.5.31 more than 2 years ago, I wouldn't hold my breath

Re: [HACKERS] Speeding up the Postgres lexer

2005-05-24 Thread Simon Riggs
On Mon, 2005-05-23 at 22:43 -0400, Tom Lane wrote: Based on the comments so far in this thread, I'll go ahead and commit the patch, with some comments attached of course --- in particular a big head comment to run flex with -b and see that lex.backup says something to this effect. flex counts

Re: [HACKERS] Speeding up the Postgres lexer

2005-05-24 Thread Tom Lane
Simon Riggs [EMAIL PROTECTED] writes: Would we use the -x switch if we had it? Dunno. Depending on such a thing would require depending on a new flex version, and seeing that the flex guys haven't put out a new release since the badly broken 2.5.31 more than 2 years ago, I wouldn't hold my

Re: [HACKERS] Speeding up the Postgres lexer

2005-05-24 Thread Neil Conway
Tom Lane wrote: Dunno. Depending on such a thing would require depending on a new flex version, and seeing that the flex guys haven't put out a new release since the badly broken 2.5.31 more than 2 years ago, I wouldn't hold my breath waiting for one we can use. It should be easy enough to

Re: [HACKERS] Speeding up the Postgres lexer

2005-05-23 Thread Bruce Momjian
This seems fine. I don't think the lexer changes enough for us to have issues with new cases. I think adding some comments to explain why we are doing it is enough, and perhaps a test case that can be reproduced later for testing.

Re: [HACKERS] Speeding up the Postgres lexer

2005-05-23 Thread Simon Riggs
On Mon, 2005-05-23 at 12:31 -0400, Tom Lane wrote: doesn't seem to be any way to get flex to complain if someone later makes a change that breaks the no-backup-cases property again. After some digging, there is a -b option will generate a file called lex.backup if any backup-states exist. The

Re: [HACKERS] Speeding up the Postgres lexer

2005-05-23 Thread Andrew Dunstan
Tom Lane wrote: [snip - flex is slowed down by backtracking - how to fix ] What I'm wondering is whether this is really worth doing or not. There are currently just two parts of the lexer rules that are affected --- the {real} rule illustrated above, and the rules that allow quoted strings

Re: [HACKERS] Speeding up the Postgres lexer

2005-05-23 Thread Christopher Kings-Lynne
What I'm wondering is whether this is really worth doing or not. There are currently just two parts of the lexer rules that are affected --- the {real} rule illustrated above, and the rules that allow quoted strings to be split across lines as the SQL spec requires. But the patches are still

Re: [HACKERS] Speeding up the Postgres lexer

2005-05-23 Thread Christopher Kings-Lynne
But I do think it's worth it, even so ... not all client interfaces support prepared statements (notoriously PHP, although I understand KL has sent patches to fix that) and not all inserts are suitable for COPY. There is now pg_prepare/pg_execute/pg_query_params in PHP, however you could

Re: [HACKERS] Speeding up the Postgres lexer

2005-05-23 Thread Tom Lane
Simon Riggs [EMAIL PROTECTED] writes: On Mon, 2005-05-23 at 12:31 -0400, Tom Lane wrote: doesn't seem to be any way to get flex to complain if someone later makes a change that breaks the no-backup-cases property again. After some digging, there is a -b option will generate a file called

Re: [HACKERS] Speeding up the Postgres lexer

2005-05-23 Thread Christopher Kings-Lynne
Based on the comments so far in this thread, I'll go ahead and commit the patch, with some comments attached of course --- in particular a big head comment to run flex with -b and see that lex.backup says something to this effect. Add it to the release check-list. Chris

Re: [HACKERS] Speeding up the Postgres lexer

2005-05-23 Thread Tom Lane
Christopher Kings-Lynne [EMAIL PROTECTED] writes: However, the lexer isn't touched anywhere near as much as the grammar is right? Yeah --- if you look at the CVS history, changes that affect the flex rules (and not just the text of the C-code actions) are really rare these days. If there