Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43293
Total Topics: 7522
Most Online Today: 118
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 110
Total: 110

Author Topic: search entire gallery setting ?  (Read 6847 times)

0 Members and 1 Guest are viewing this topic.

Offline spikeweb

  • Member
  • *
  • Posts: 38
    • View Profile
search entire gallery setting ?
« on: June 20, 2011, 08:23:56 am »
I checked the forum but did not find an answer. Is there a way to prevent users to search the entire gallery ?

I actually have a gallery with 10000+ images and from time to time, the web server has to handle a long request. The last one is :

Code: [Select]
Query_time: 381
Lock_time: 0
Rows_sent: 10626
Rows_examined: 120771768

SELECT
                               COUNT(*) as total
                       FROM (forum1_gallery_pic as p, forum1_gallery_comment as com)

               LEFT JOIN forum1_members AS m  ON (m.ID_MEMBER = p.ID_MEMBER)
               LEFT JOIN forum1_gallery_usersettings AS s ON (s.ID_MEMBER = m.ID_MEMBER)
               LEFT JOIN forum1_gallery_log_mark_view AS v ON (p.ID_PICTURE = v.ID_PICTURE AND v.ID_MEMBER = 25659 AND v.user_id_cat = p.USER_ID_CAT)
                                       WHERE ((s.private =0 || s.private IS NULL ) AND (s.password = '' || s.password IS NULL ) AND p.USER_ID_CAT !=0 AND p.a
pproved =1) || (p.approved =1 AND p.USER_ID_CAT =0)   AND com.ID_PICTURE = p.ID_PICTURE GROUP BY p.ID_PICTURE;

I wonder how to prevent a guest user/registered user to start search a search.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: search entire gallery setting ?
« Reply #1 on: June 20, 2011, 08:32:36 am »
That query from above is not from search but from the "recentcomments" index display box on the gallery index

If you can do a quick test for me see how long this one takes
Code: [Select]
SELECT
                               COUNT(*) as total
                       FROM (forum1_gallery_pic as p, forum1_gallery_comment as com)

               LEFT JOIN forum1_members AS m  ON (m.ID_MEMBER = p.ID_MEMBER)
               LEFT JOIN forum1_gallery_usersettings AS s ON (s.ID_MEMBER = m.ID_MEMBER)
               LEFT JOIN forum1_gallery_log_mark_view AS v ON (p.ID_PICTURE = v.ID_PICTURE AND v.ID_MEMBER = 25659 AND v.user_id_cat = p.USER_ID_CAT)
                                       WHERE com.ID_PICTURE = p.ID_PICTURE AND ((s.private =0 || s.private IS NULL ) AND (s.password = '' || s.password IS NULL ) AND p.USER_ID_CAT !=0 AND p.a
pproved =1) || (p.approved =1 AND p.USER_ID_CAT =0)   GROUP BY p.ID_PICTURE;

If you need to code to disable the search let me know along with the SMF version used
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline spikeweb

  • Member
  • *
  • Posts: 38
    • View Profile
Re: search entire gallery setting ?
« Reply #2 on: June 20, 2011, 08:54:03 am »
I just ran the query from phpMyAdmin as the previous one was read in the server log :

SELECT COUNT( * ) AS total
FROM (
forum1_gallery_pic AS p, forum1_gallery_comment AS com
)
LEFT JOIN forum1_members AS m ON ( m.ID_MEMBER = p.ID_MEMBER )
LEFT JOIN forum1_gallery_usersettings AS s ON ( s.ID_MEMBER = m.ID_MEMBER )
LEFT JOIN forum1_gallery_log_mark_view AS v ON ( p.ID_PICTURE = v.ID_PICTURE
AND v.ID_MEMBER =25659
AND v.user_id_cat = p.USER_ID_CAT )
WHERE com.ID_PICTURE = p.ID_PICTURE
AND (
(
s.private =0 || s.private IS NULL
)
AND (
s.password = '' || s.password IS NULL
)
AND p.USER_ID_CAT !=0
AND p.approved =1
) || ( p.approved =1
AND p.USER_ID_CAT =0 )
GROUP BY p.ID_PICTURE
LIMIT 0 , 30


The answer is : Affichage des lignes 0 - 29 (1 620 total, Traitement en 9.3797 sec.)

in english : display for lines 0 - 29 (1 620 in total, execution time 9.3797 sec.)

did it help ??

Gallery version is 3.0.22

Offline spikeweb

  • Member
  • *
  • Posts: 38
    • View Profile
Re: search entire gallery setting ?
« Reply #3 on: June 20, 2011, 08:56:31 am »
oopppss, just realized that phpMyAdmin allows only 30 results to be displayed.

I can ask my server admin to run the full query ...

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: search entire gallery setting ?
« Reply #4 on: June 20, 2011, 09:06:17 am »
What SMF Version are you using going to try something
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline spikeweb

  • Member
  • *
  • Posts: 38
    • View Profile
Re: search entire gallery setting ?
« Reply #5 on: June 20, 2011, 09:09:06 am »
SMF is 1.1.14

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: search entire gallery setting ?
« Reply #6 on: June 20, 2011, 09:18:32 am »
It was actually the listall feature for the recent comments block.

Made a couple changes copy this file to your sources folder and let me know if it helps
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline spikeweb

  • Member
  • *
  • Posts: 38
    • View Profile
Re: search entire gallery setting ?
« Reply #7 on: June 20, 2011, 11:02:18 am »
Here is the result of the query as requested :

# Query_time: 29  Lock_time: 0  Rows_sent: 1611  Rows_examined: 23626208

Will check your file and let you know ... :)

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
4685 Views
Last post August 06, 2007, 09:34:02 pm
by rumboogy
1 Replies
3546 Views
Last post February 25, 2009, 10:47:25 pm
by SMFHacks
2 Replies
4530 Views
Last post May 27, 2012, 07:05:37 pm
by VinnyH
2 Replies
3432 Views
Last post December 19, 2014, 08:08:57 am
by Jonas1975
1 Replies
3208 Views
Last post December 29, 2016, 10:09:18 am
by SMFHacks

+- Recent Topics

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

Powered by EzPortal