qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.03k stars 2.92k forks source link

Open Attribute Table -- LIMIT by default to X items #57835

Open cochetti opened 2 weeks ago

cochetti commented 2 weeks ago

Feature description

  1. Request

Limit the number of rows output by open attribute table by default, add a button to override to show all.

I frequently like to check the attribute table to see whether the data has written correctly, the a by-location query has joined correctly, to check xyz points, etc. I have noticed the significant overhead of this operation and it has crashed the program a number of times.

I would like to suggest using the LIMIT option on the SQL query behind the "Open Attribute Table" is activated by default. This is customary in many (if not most) SQL varieties and saves network bandwidth, memory access, RAM, and basically can only help users. There are very few users who would knowingly and without hesitation open a 36,000,000+ point table. I suspect that having a liberal enough limit, but large enough to be representative will meet most users' needs.

  1. Expanded Feature

    Randomly select among points when doing so

To be perfect certain of that fact the addition of the following query would randomly select points to make sure that if the data are specifically ordered the first ones aren't all drawn from a single corner of the map:

SELECT *
FROM layer
ORDER BY rand()
LIMIT 50000 

Additional context

No response

NyakudyaA commented 2 weeks ago

The attribute toolbar already has options to prevent you from opening a large attribute table

Screenshot 2024-06-23 at 16 37 07

I think a better solution would be to add the option to the context menu with the options you requesting i.e

What would be the use case for opening the first 100 random features? Is it to inspect the data only? I feel like most of these options are already available i.e

In processing select Random Selection In the attribute toolbar choose Open Attribute table Selected Features