Open dingausmwald opened 3 years ago
@dingausmwald please attach a dataset we can use for local tests.
Same goes for select by expression (COUNT(1, "attribute")>1)
Ok I see the freeze, but only when doing the sort within the table as from processing seems ok.
Hi @dingausmwald, you could try with a subset of your layer of e.g. 1000 records and you will see it works in a reasonable amount of time.
I think this approach is inefficient 'cause the same calculations (group 47000 records and count the occurrences of all the groups) will be re-evaluated for each row, i.e. 47000 times.
Could be better to relies on the RDBMS functionalities of i.e. a Virtual Layer to do this job.
For example you could create a Virtual Layer using the SQL statements:
select Adressen.*, B.count from Adressen left join (select adresse, count(*) as count from Adressen group by adresse) B on Adressen.adresse = B.adresse
that adds a column with the number of the occurrences, and then you can sort by this column.
I think this approach is inefficient 'cause the same calculations (group 47000 records and count the occurrences of all the groups) will be re-evaluated for each row, i.e. 47000 times.
then shouldn't we warn the users when using some type of operators? By the way... it is really just a matter to wait a looong time, is not a complete freeze.
@gioman, I've also tested the provided layer file using the Select by Expression (COUNT(1, "adresse")>1) tool with QGIS 2.18.23 and 3.4.9 and it seems they behave the same way of QGIS 3.10 and 3.16.
So not a bug, just inefficient operation.
Still valid on QGIS 3.22.3.
Are we able to abort the operation or is qgis just frozen?
From what I've tested, QGIS simply freezes. It was able to complete this selection after waiting for 10 minutes tho.
3.16 windows 10 x64 geopackage local/network drive/shapefile local
Point layer in different formats (shp, geopackage), from different sources (local, networkdrive), with about 47000 objects. When trying to sort for duplicates ( count("FieldWithDuplicates","FieldWithDuplicates") ) qgis freezes, prozessor is working. No result after 20 min.
was working on 3.4