Re: LIMIT OFFSET with DB view vs plain SQL

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

 



Raj Gandhi wrote:
> I’m using LIMIT offset with DB view. Looks like query planner is applying the LIMIT for DB view at the end after processing all rows.
> When running same SQL that was used to create the DB view, LIMIT is applied earlier so the query is much faster.
>  
> Explain plan using DB view
> https://explain.depesz.com/s/gzjQ
>  
> Explain plan using raw SQL
> https://explain.depesz.com/s/KgwO
>  
> In both tests LIMIT was 100 with offset  = 0.
> Is there any way to force DB view to apply limit earlier?

Please show

- the view definition
- the query on the view
- the query without the view

Yours,
Laurenz Albe
-- 
+43-670-6056265
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26, A-2700 Wiener Neustadt
Web: https://www.cybertec-postgresql.com






[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