Disable Syntax Highlighting in DB Manager

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Disable Syntax Highlighting in DB Manager

Lee Hachadoorian-2
I find the DB Manager SQL window to be unusable, and have confirmed that
it is because of syntax highlighting by disabling this feature in my
installation. There is an issue already in the tracker
https://hub.qgis.org/issues/6995 entitled "db manager's SQL window
freezes with long query (due to syntax coloring?)". Giuseppe suggests:

 > Pasting or editing such a query makes highlighting process slow here,
but it doesn't freeze (it could depend on resources available on my
notebook). I could check the query length, but using a 124190 chars
query long is something not usual anyway...

This is correct in that QGIS does not completely stop responding, but
the latency is so high as to make the dialog unusable for anything other
than pasting in an already tested query. Try, for example, typing
`SELECT 1;` into the window, and see how long it takes you. I'm running
QGIS on a Linux Mint 13 laptop with an i7 processor and 8GB RAM, so I
don't think this has anything to do with system resources.

At the moment, I have altered my local version by commenting out lines
34 and 56 of
/usr/share/qgis/python/plugins/db_manager/dlg_sql_window.py. I would
like to suggest that until some time can be invested in making the
syntax highlighting functionality usable (if there is even interest in
doing so for a feature that is just eye candy), that this change be
tested and incorporated in the official version.

Respectfully and with thanks to those who have created and contributed
to the DB Manager plugin,
--Lee


--
Lee Hachadoorian
Assistant Professor in Geography, Dartmouth College
http://freecity.commons.gc.cuny.edu

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Disable Syntax Highlighting in DB Manager

ginetto
I can't confirm... 

"Try, for example, typing `SELECT 1;` into the window, and see how long it takes you"

I can't repeat the problems doing this... can you post a better test case?

Luigi Pirelli ([hidden email])


On 24 November 2013 22:24, Lee Hachadoorian <[hidden email]> wrote:
I find the DB Manager SQL window to be unusable, and have confirmed that it is because of syntax highlighting by disabling this feature in my installation. There is an issue already in the tracker https://hub.qgis.org/issues/6995 entitled "db manager's SQL window freezes with long query (due to syntax coloring?)". Giuseppe suggests:

> Pasting or editing such a query makes highlighting process slow here, but it doesn't freeze (it could depend on resources available on my notebook). I could check the query length, but using a 124190 chars query long is something not usual anyway...

This is correct in that QGIS does not completely stop responding, but the latency is so high as to make the dialog unusable for anything other than pasting in an already tested query. Try, for example, typing `SELECT 1;` into the window, and see how long it takes you. I'm running QGIS on a Linux Mint 13 laptop with an i7 processor and 8GB RAM, so I don't think this has anything to do with system resources.

At the moment, I have altered my local version by commenting out lines 34 and 56 of /usr/share/qgis/python/plugins/db_manager/dlg_sql_window.py. I would like to suggest that until some time can be invested in making the syntax highlighting functionality usable (if there is even interest in doing so for a feature that is just eye candy), that this change be tested and incorporated in the official version.

Respectfully and with thanks to those who have created and contributed to the DB Manager plugin,
--Lee


--
Lee Hachadoorian
Assistant Professor in Geography, Dartmouth College
http://freecity.commons.gc.cuny.edu

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Disable Syntax Highlighting in DB Manager

Giuseppe Sucameli
In reply to this post by Lee Hachadoorian-2
Hi Lee,

On Sun, Nov 24, 2013 at 10:24 PM, Lee Hachadoorian <[hidden email]> wrote:
I find the DB Manager SQL window to be unusable, and have confirmed that it is because of syntax highlighting [...].
 [...]
This is correct in that QGIS does not completely stop responding, but the latency is so high as to make the dialog unusable for anything other than pasting in an already tested query.

A very long query (>100.000 chars) takes a long time (>10 secs) to be parsed... linearly.

 
Try, for example, typing `SELECT 1;` into the window, and see how long it takes you.

It highlights it quite immediately, I'm unable to see any latency.
How many time does it take to run on your system?

At the moment, I have altered my local version by commenting out lines 34 and 56 of /usr/share/qgis/python/plugins/db_manager/dlg_sql_window.py. I would like to suggest that until some time can be invested in making the syntax highlighting functionality usable (if there is even interest in doing so for a feature that is just eye candy), that this change be
tested and incorporated in the official version.

The syntax highlighting is already usable as it is, nobody else is experiencing any issue with it... Surely it can be improved, but definitely it's not just eye candy, as it helps in writing queries.

We may add a check to skip syntax highlighting when the query is very long, but it won't help in your case.
It's better to add a way to disable it when not needed or whether it cause any trouble.

Regards.
Giuseppe.
 
--Lee


--
Lee Hachadoorian
Assistant Professor in Geography, Dartmouth College
http://freecity.commons.gc.cuny.edu

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer



--
Giuseppe Sucameli

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Disable Syntax Highlighting in DB Manager

Nyall Dawson
>
> The syntax highlighting is already usable as it is, nobody else is
> experiencing any issue with it... Surely it can be improved, but definitely
> it's not just eye candy, as it helps in writing queries.
>

I don't think it's the syntax highlighting that's the issue - I think
it's related to the auto complete function. I regularly see this lag,
and it always occurs for me when the sql window is trying to populate
the autocomplete drop down list. Sometimes it will take 2-3 seconds to
display the list, during which the window is unresponsive.

(This is using the osgeo4w nightly builds with a Postgresql 9.3 server) .

Nyall
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Disable Syntax Highlighting in DB Manager

Lee Hachadoorian-2

On 11/24/2013 08:10 PM, Nyall Dawson wrote:

>> The syntax highlighting is already usable as it is, nobody else is
>> experiencing any issue with it... Surely it can be improved, but definitely
>> it's not just eye candy, as it helps in writing queries.
>>
> I don't think it's the syntax highlighting that's the issue - I think
> it's related to the auto complete function. I regularly see this lag,
> and it always occurs for me when the sql window is trying to populate
> the autocomplete drop down list. Sometimes it will take 2-3 seconds to
> display the list, during which the window is unresponsive.
>
> (This is using the osgeo4w nightly builds with a Postgresql 9.3 server) .
>
> Nyall

I've created two screencasts [1] of me keying in a 310 character query.
With syntax highlighting enabled this took 6 minutes, while with
highlighting disabled it took one-quarter as long (1½ minutes). The
query was a query I had already composed (viewing off camera), so when
you see the cursor pause that is not me thinking what to type next, that
is me waiting for the characters buffered to hit the screen so that I
can continue typing. Please view the videos (Ogg Vorbis format) to see
what I am talking about.

Occasionally there were typoes (mimicking real life typing). The latency
introduced by syntax highlighting aggravates typo-ing, because I'm
usually typing several characters ahead of the display, whereas without
the latency I see the typoed character right away and backspace to fix it.

My first thought was also that it was code completion (thought it was DB
round trips), but the second video shows that with highlighting off and
code completion on, there is no latency.

Best,
--Lee

[1] https://www.dropbox.com/sh/arbqwx0pg12yufm/rNv25CKlFK

--
Lee Hachadoorian
Assistant Professor in Geography, Dartmouth College
http://freecity.commons.gc.cuny.edu

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Disable Syntax Highlighting in DB Manager

Lee Hachadoorian-2

On 11/24/2013 09:07 PM, Lee Hachadoorian wrote:

>
> On 11/24/2013 08:10 PM, Nyall Dawson wrote:
>>> The syntax highlighting is already usable as it is, nobody else is
>>> experiencing any issue with it... Surely it can be improved, but
>>> definitely
>>> it's not just eye candy, as it helps in writing queries.
>>>
>> I don't think it's the syntax highlighting that's the issue - I think
>> it's related to the auto complete function. I regularly see this lag,
>> and it always occurs for me when the sql window is trying to populate
>> the autocomplete drop down list. Sometimes it will take 2-3 seconds to
>> display the list, during which the window is unresponsive.
>>
>> (This is using the osgeo4w nightly builds with a Postgresql 9.3
>> server) .
>>
>> Nyall
>
> I've created two screencasts [1] of me keying in a 310 character
> query. With syntax highlighting enabled this took 6 minutes, while
> with highlighting disabled it took one-quarter as long (1½ minutes).
> The query was a query I had already composed (viewing off camera), so
> when you see the cursor pause that is not me thinking what to type
> next, that is me waiting for the characters buffered to hit the screen
> so that I can continue typing. Please view the videos (Ogg Vorbis
> format) to see what I am talking about.
>
> Occasionally there were typoes (mimicking real life typing). The
> latency introduced by syntax highlighting aggravates typo-ing, because
> I'm usually typing several characters ahead of the display, whereas
> without the latency I see the typoed character right away and
> backspace to fix it.
>
> My first thought was also that it was code completion (thought it was
> DB round trips), but the second video shows that with highlighting off
> and code completion on, there is no latency.
>
> Best,
> --Lee
>
> [1] https://www.dropbox.com/sh/arbqwx0pg12yufm/rNv25CKlFK
>

It seems one person has observed what I'm talking about, and two say
they don't see the latency. If I may ask those who say they aren't
experiencing it, is there really no latency, or is it just that waiting
a few seconds here and there for the characters to catch up to your
typing is not that big a deal? Obviously, this could be a difference of
opinion as to what one person considers useful/usable or not useful/not
usable. And also, "eye candy" was perhaps too strong of a term. Syntax
highlighting *is* useful, I just find the latency so bad on my
installation as to make the benefit not worth it.

BTW, I also just now tested on Windows (QGIS 2.0.1 installed with
OSGeo4W) and found the same behavior. Latency normally, but no latency
if I disable syntax highlighting.

Would be curious if there is a compromise that could satisfy those of
who find this to be a problem and those of us who do not have the issue
and want to retain highlighting. (With, of course, one possible
compromise being that I just edit dlg_sql_windows.py every time I
upgrade QGIS.)

Best,
--Lee
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Disable Syntax Highlighting in DB Manager

pcav
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Il 25/11/2013 04:13, Lee Hachadoorian ha scritto:

> It seems one person has observed what I'm talking about, and two
> say they don't see the latency. If I may ask those who say they
> aren't

IMHO syntax highlighting and auto completion are two important
features (remember: QGIS is aimed *also* to SQL beginners), not to be
removed. If something is slow (and I agree that sometimes it is), this
must be speeded up, not removed.
Also, adding (yet another) optional switch is confusing, and should be
avoided.
All the best.

- --
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlKS74UACgkQ/NedwLUzIr79WwCgksTO+MaNLOPahgxljBqix5Cb
0OYAoLmvrIgnM6D+C6P2wZ7VGEl687VI
=MK6R
-----END PGP SIGNATURE-----
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Disable Syntax Highlighting in DB Manager

Giuseppe Sucameli
In reply to this post by Lee Hachadoorian-2

On Mon, Nov 25, 2013 at 4:13 AM, Lee Hachadoorian <[hidden email]> wrote:
If I may ask those who say they aren't experiencing it, is there really no latency, or is it just that waiting a few seconds here and there for the characters to catch up to your typing is not that big a deal?

zero latency. The chars I type are displayed and highlighted immediately.


--
Giuseppe Sucameli

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Disable Syntax Highlighting in DB Manager

Giuseppe Sucameli
In reply to this post by pcav
Hi Paolo,

On Mon, Nov 25, 2013 at 7:34 AM, Paolo Cavallini <[hidden email]> wrote:
If something is slow (and I agree that sometimes it is), this
must be speeded up, not removed.

+1, btw I cannot do anything to speed it up until I reproduce it.
 
Also, adding (yet another) optional switch is confusing, and should be
avoided.

It would be just a way to disable it when cause issues... instead of answering
people they has to edit the source code...
 
All the best.

- --
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlKS74UACgkQ/NedwLUzIr79WwCgksTO+MaNLOPahgxljBqix5Cb
0OYAoLmvrIgnM6D+C6P2wZ7VGEl687VI
=MK6R
-----END PGP SIGNATURE-----
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer



--
Giuseppe Sucameli

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Disable Syntax Highlighting in DB Manager

pcav
In reply to this post by Giuseppe Sucameli
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Il 25/11/2013 10:32, Giuseppe Sucameli ha scritto:

> zero latency. The chars I type are displayed and highlighted immediately.

with very slow machines, I confirm taht a lag is noticeable, but not a serious issue
here.

- --
Paolo Cavallini - www.faunalia.eu
Corsi QGIS e PostGIS: http://www.faunalia.eu/training.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iEYEARECAAYFAlKTaiQACgkQ/NedwLUzIr6lewCbB2ZSs8bmzdTOmOhlRO+wOcGe
xrsAniWqjtJROquk75A4arWY8mZ3WxvS
=Tu+d
-----END PGP SIGNATURE-----
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Disable Syntax Highlighting in DB Manager

Lee Hachadoorian-2
In reply to this post by Giuseppe Sucameli

On 11/25/2013 04:37 AM, Giuseppe Sucameli wrote:
Hi Paolo,

On Mon, Nov 25, 2013 at 7:34 AM, Paolo Cavallini <[hidden email]> wrote:
If something is slow (and I agree that sometimes it is), this
must be speeded up, not removed.

+1, btw I cannot do anything to speed it up until I reproduce it.


Understood. Let me know if there is anything (short of mailing you my laptop) that I can do to help identify affected machines, causes, etc.

Best,
--Lee

-- 
Lee Hachadoorian
Assistant Professor in Geography, Dartmouth College
http://freecity.commons.gc.cuny.edu

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Disable Syntax Highlighting in DB Manager

Régis Haubourg
Hi,
I am facing the issue too, with a very fast workstation , windows 7 OSGEO4W 64bits.  Maybe Qscintilla version differ?
Régis