[ckan-dev] Preview from datastore, count(*) takes very long time on large resources.

David Raznick david.raznick at okfn.org
Wed Dec 11 11:01:55 UTC 2013


Hello

My preference would be to use the statistics (which is fast) and if
the stats say its over a certain threshold say 100,000 rows then use
that number as an estimate, otherwise query for the actual count.
Adding a table with counts has performance costs when writing and its
hard to do correctly on concurrent changes as you need locking.

David

On 11 December 2013 10:09, Henrik Aagaard Sørensen <BU1G at tmf.kk.dk> wrote:
> That is true.
>
> I don't know if it is a common issue. If so, perhaps it could be an idea to create a table which stored count's on other tables.
> And creating a general trigger, which could update the table-counts on insert and delete?
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev



More information about the ckan-dev mailing list