Re: postgresql is slow with larger table even it is in RAM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I can't really say anything about your RAM issue, but count(*) is always a bad
idea if it can be avoided. Assuming you have a primary key on the table, do a
count(pk). In my experience that alone cuts down up to 30% of execution time.

i want exact count so am doing this...

But as you are saying it is not doing so,
at first without primary key i had a column "id", it took the same 3 seconds to show the count, after reading some tips i created primary key on that "id", and i did select count(id) from table, and now also it is taking the same 3 seconds.


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux